//============================================================================================
/**
 * @file	zkn2_obj.c
 * @brief	金銀図鑑画面 OBJ関連
 * @author	Hiroyuki Nakamura
 * @date	08.08.26
 */
//============================================================================================
#include "common.h"

#include "system/gra_tool.h"
#include "poketool/pokeicon.h"
#include "poketool/pokefoot.h"
#include "battle/graphic/batt_obj_gs_def.h"
#include "application/app_tool.h"

#include "fielddata/maptable/zone_id.h"

#include "application/zukanlist/zkn_world_text_data.h"

#include "zkn2_main.h"
#include "zkn2_obj.h"
#include "zkn2_tool.h"
#include "zkn2_list.h"

#include "zukan_gra.naix"


//============================================================================================
//	定数定義
//============================================================================================

// アクター表示フラグ
enum {
	ACT_OFF = 0,	// アクター非表示
	ACT_ON			// アクター表示
};

#define	CLACT_ID_COMMON		( 50512 )	// この画面で使用するセルアクターのID

// キャラリソースID
enum {
	CHR_ID_POKEICON = CLACT_ID_COMMON,	// ポケモンアイコン
	CHR_ID_POKEGRA1 = CHR_ID_POKEICON + ZKN2_POKEICON_ADD_MAX*2,
	CHR_ID_POKEGRA2,
	CHR_ID_POKEGRA3,
	CHR_ID_POKEGRA4,
	CHR_ID_ZKNOBJ_M,
	CHR_ID_ZKNOBJ_S,
	CHR_ID_BALL_S,
	CHR_ID_TYPEICON1,
	CHR_ID_TYPEICON2,
	CHR_ID_TYPEICON3,
	CHR_ID_TYPEICON4,
	CHR_ID_LANGICON_M,
	CHR_ID_LANGICON_S,
	CHR_ID_POKEFOOT,
	CHR_ID_POS_S,
	CHR_ID_MYICON_M,
	CHR_ID_MYICON_S,
	CHR_ID_MYSILHOUETTE,
	CHR_ID_SEARCH_S,
	CHR_ID_SEARCH_FORM_S,
	CHR_ID_SEARCH_FORM,
	CHR_ID_MAX = CHR_ID_SEARCH_FORM - CLACT_ID_COMMON + 1
};
// パレットリソースID
enum {
	PAL_ID_POKEICON = CLACT_ID_COMMON,	// ポケモンアイコン
	PAL_ID_POKEICON_S,
	PAL_ID_POKEGRA1,
	PAL_ID_POKEGRA2,
	PAL_ID_POKEGRA3,
	PAL_ID_POKEGRA4,
	PAL_ID_ZKNOBJ_M,
	PAL_ID_ZKNOBJ_S,
	PAL_ID_TYPEICON,
	PAL_ID_LANGICON_M,
	PAL_ID_LANGICON_S,
	PAL_ID_POKEFOOT,
	PAL_ID_POS_S,
	PAL_ID_MYICON_M,
	PAL_ID_MYICON_S,
	PAL_ID_SEARCH_S,
	PAL_ID_SEARCH_FORM_S,
	PAL_ID_SEARCH_FORM,
	PAL_ID_MAX = PAL_ID_SEARCH_FORM - CLACT_ID_COMMON + 1
};
// セルリソースID
enum {
	CEL_ID_POKEICON = CLACT_ID_COMMON,	// ポケモンアイコン
	CEL_ID_POKEGRA,
	CEL_ID_ZKNOBJ_M,
	CEL_ID_ZKNOBJ_S,
	CEL_ID_BALL_S,
	CEL_ID_TYPEICON,
	CEL_ID_LANGICON_M,
	CEL_ID_LANGICON_S,
	CEL_ID_POKEFOOT,
	CEL_ID_POS,
	CEL_ID_MYICON,
	CEL_ID_MYSILHOUETTE,
	CEL_ID_SEARCH_S,
	CEL_ID_SEARCH_FORM_S,
	CEL_ID_SEARCH_FORM,
	CEL_ID_MAX = CEL_ID_SEARCH_FORM - CLACT_ID_COMMON + 1
};
// セルアニメリソースID
enum {
	ANM_ID_POKEICON = CLACT_ID_COMMON,	// ポケモンアイコン
	ANM_ID_POKEGRA,
	ANM_ID_ZKNOBJ_M,
	ANM_ID_ZKNOBJ_S,
	ANM_ID_BALL_S,
	ANM_ID_TYPEICON,
	ANM_ID_LANGICON_M,
	ANM_ID_LANGICON_S,
	ANM_ID_POKEFOOT,
	ANM_ID_POS,
	ANM_ID_MYICON,
	ANM_ID_MYSILHOUETTE,
	ANM_ID_SEARCH_S,
	ANM_ID_SEARCH_FORM_S,
	ANM_ID_SEARCH_FORM,
	ANM_ID_MAX = ANM_ID_SEARCH_FORM - CLACT_ID_COMMON + 1
};

#define	ZKN2_SUB_ACTOR_DISTANCE	( 512*FX32_ONE )	// サブ画面のOBJ表示Y座標オフセット

#define	CLA_H_NONE	( CLACT_U_HEADER_DATA_NONE )	// セルアクターヘッダーデータなし

// パレット配置
#define	PALSIZ_POKEICON			( POKEICON_PAL_MAX )	// パレット数：ポケモンアイコン
#define	PALSIZ_ZKNOBJ_M			( 5 )					// パレット数：その他ＯＢＪ
#define	PALSIZ_LANGICON			( 1 )					// パレット数：言語アイコン
#define	PALSIZ_SEARCH_FORM_M	( 1 )					// パレット数：形検索アイコン
#define	PALSIZ_POKEGRA1			( 1 )					// パレット数：ポケモングラフィック
#define	PALSIZ_POKEFOOT			( 1 )					// パレット数：足跡
#define	PALSIZ_TYPEICON			( 4 )					// パレット数：タイプアイコン
#define	PALSIZ_ZKNOBJ_S			( 1 )					// パレット数：その他ＯＢＪ
#define	PALSIZ_SEARCH_S			( 1 )					// パレット数：ヤドン・ゲージ
#define	PALSIZ_MYICON			( 1 )					// パレット数：主人公関連
#define	PALSIZ_FACEICON			( 1 )					// パレット数：現在地
#define	PALSIZ_POS_S			( 2 )					// パレット数：出現場所

#define	LIST_POKEICON_PX	( 48 )		// リスト画面のポケモンアイコン表示Ｘ座標
#define	LIST_POKEICON_PY	( 24 )		// リスト画面のポケモンアイコン表示Ｙ座標
#define	LIST_POKEICON_SX	( 40 )		// リスト画面のポケモンアイコン表示Ｘ間隔
#define	LIST_POKEICON_SY	( 40 )		// リスト画面のポケモンアイコン表示Ｙ間隔

#define	LIST_CURSOR_PX	( 48 )		// リスト画面のカーソル表示Ｘ座標
#define	LIST_CURSOR_PY	( 24 )		// リスト画面のカーソル表示Ｙ座標
#define	LIST_CURSOR_SX	( 40 )		// リスト画面のカーソル表示Ｘ間隔
#define	LIST_CURSOR_SY	( 40 )		// リスト画面のカーソル表示Ｙ間隔

#define	LIST_RAIL_PX	( 242 )		// リスト画面のレール表示Ｘ座標
#define	LIST_RAIL_PY	( 76 )		// リスト画面のレール表示Ｙ座標
#define	LIST_RAIL_SY	( 110 )		// リスト画面のレール部分のＹサイズ

#define	POKEGRA_TEX_SIZE	( 0x20 * 100 )	// ポケモン一枚絵データ：テクスチャサイズ
#define	POKEGRA_PAL_SIZE	( 0x20 )		// ポケモン一枚絵データ：パレットサイズ

#define	TYPEICON_X_SPACE	( 49 )			// タイプアイコン配置間隔

#define	LISTSUB_LANGICON_PX		( 124 )		// 言語アイコン表示Ｘ座標
#define	LISTSUB_LANGICON_PY		( 8 )		// 言語アイコン表示Ｙ座標
#define	LISTSUB_LANGICON_SX		( 24 )		// 言語アイコンＸサイズ

#define	TOP_SWITCH_ZENKOKU_X	( 112 )		// モドード切り替えスイッチ表示Ｘ座標（ぜんこく）
#define	TOP_SWITCH_JOHTO_X		( 144 )		// モドード切り替えスイッチ表示Ｘ座標（ジョウト）
#define	TOP_SWITCH_Y			( 128 )		// モドード切り替えスイッチ表示Ｙ座標

#define	COVER_SWITCH_SX_HALF	( 32/2 )	// モード切替スイッチＸ半サイズ
#define	COVER_SWITCH_SY_HALF	( 32/2 )	// モード切替スイッチＹ半サイズ

#define	LIST_BAR_SX		( 22 )		// リスト切り替えバーＸサイズ

// 詳細・姿ページ１のポケモン表示座標
#define	FORM1_POKE_L_PX		( 64 )
#define	FORM1_POKE_L_PY		( 120 )
#define	FORM1_POKE_R_PX		( 192 )
#define	FORM1_POKE_R_PY		( 120 )

// 操作OBJの表示画面
enum {
	OBJ_PUT_DISP_MAIN = 0,	// メイン（下）
	OBJ_PUT_DISP_SUB,		// サブ（上）
};

#define	FORMLIST_RAIL_PX	( 242 )		// フォルムリスト画面のレール表示Ｘ座標
#define	FORMLIST_RAIL_PY	( 64 )		// フォルムリスト画面のレール表示Ｙ座標
#define	FORMLIST_RAIL_SY	( 86 )		// フォルムリスト画面のレール部分のＹサイズ

#define	PLACELIST_RAIL_PX	( 242 )		// フォルムリスト画面のレール表示Ｘ座標
#define	PLACELIST_RAIL_PY	( 96 )		// フォルムリスト画面のレール表示Ｙ座標
#define	PLACELIST_RAIL_SY	( 86 )		// フォルムリスト画面のレール部分のＹサイズ

// ポケモングラフィックパレット読み込み位置
enum {
	POKEGRA_PAL_VRAM = 0,	// VRAM
	POKEGRA_PAL_FADE,		// パレットフェードワーク
	POKEGRA_PAL_NONE,		// なし
};

#define	DETAIL_CURSOR_SX	( 64 )		// 詳細画面カーソルＸ表示間隔
#define	DETAIL_CURSOR_PX	( 32 )		// 詳細画面カーソルＸ座標
#define	DETAIL_CURSOR_PY	( 176 )		// 詳細画面カーソルＹ座標

#define	FORM2_POKEICON_LPX	( 64 )					// 姿比べ：左のポケモンアイコン表示Ｘ座標
#define	FORM2_POKEICON_LPY	( 80 )					// 姿比べ：左のポケモンアイコン表示Ｙ座標
#define	FORM2_POKEICON_RPX	( 192 )					// 姿比べ：右のポケモンアイコン表示Ｘ座標
#define	FORM2_POKEICON_RPY	( FORM2_POKEICON_LPY )	// 姿比べ：右のポケモンアイコン表示Ｙ座標
#define	FORM2_CURSOR_LPX	( FORM2_POKEICON_LPX )	// 姿比べ：左のカーソル表示Ｘ座標
#define	FORM2_CURSOR_LPY	( 88 )					// 姿比べ：左のカーソル表示Ｙ座標
#define	FORM2_CURSOR_RPX	( FORM2_POKEICON_RPX )	// 姿比べ：右のカーソル表示Ｘ座標
#define	FORM2_CURSOR_RPY	( FORM2_CURSOR_LPY )	// 姿比べ：右のカーソル表示Ｙ座標

#define	PLACE_TIME_CURSOR_PX	( 32 )		// 分布：時間カーソル表示Ｘ座標
#define	PLACE_TIME_CURSOR_PY	( 76 )		// 分布：時間カーソル表示Ｙ座標
#define	PLACE_TIME_CURSOR_SY	( 32 )		// 分布：時間カーソルＸ表示間隔

#define	ZKN2_TYPEICON_CGX_SIZE	( 0x20 * 6 * 2 )	// タイプアイコンのキャラデータサイズ

// 検索画面フォルム表示座標
#define	SEARCH_FORM_MAIN_PX		( 224 )
#define	SEARCH_FORM_MAIN_PY		( 72 )
#define	SEARCH_FORM_LIST_SEL_PX	( 152 )
#define	SEARCH_FORM_LIST_SEL_PY	( 20 )
#define	SEARCH_FORM_LIST_PX		( 32 )
#define	SEARCH_FORM_LIST_PY		( 56 )
#define	SEARCH_FORM_LIST_SX		( 48 )
#define	SEARCH_FORM_LIST_SY		( 40 )
#define	SEARCH_FORM_LIST_X_MAX	( 5 )

// 高さ/重さ検索用データ
#define	SEARCH_HW_MAX_X				( 204 )
#define	SEARCH_HW_MIN_X				( 52 )
#define	SEARCH_HW_MAXMIN_DOT_SIZ	( SEARCH_HW_MAX_X - SEARCH_HW_MIN_X )
#define	SEARCH_HW_NUM_PX	( -16 )
#define	SEARCH_HW_NUM_SX	( 8 )
#define	SEARCH_HW_CUR_PX	( 0 )

// 分布データ
#define	MBLOCK_GRID		( ZUKAN_MBLOCK_GRID )
#define	ENC_MAP_DEF_PX	( 64 )
#define	ENC_MAP_DEF_PY	( 40 )
#define	FACE_ICON_PX	( ENC_MAP_DEF_PX+4 )
#define	FACE_ICON_PY	( ENC_MAP_DEF_PY+4 )
#define	FACE_ICON_KANTO_GRID	( 23 )

// 分布場所アニメテーブル
enum {
	PLACE_POS_ANM_1x1 = 0,
	PLACE_POS_ANM_2x1,
	PLACE_POS_ANM_3x1,
	PLACE_POS_ANM_4x1,
	PLACE_POS_ANM_5x1,
	PLACE_POS_ANM_6x1,
	PLACE_POS_ANM_1x2,
	PLACE_POS_ANM_1x3,
	PLACE_POS_ANM_1x4,
	PLACE_POS_ANM_1x5,
	PLACE_POS_ANM_2x2,
	PLACE_POS_ANM_3x2,
};

// ２番道路用の定義
#define	R02_GRID_X	( 32 )
#define	R02_GRID_Y	( 4 )
#define	R02_SIZE_X	( 1 )
#define	R02_SIZE_Y	( 3 )
// 16番道路用の定義
#define	R16_GRID_X	( 35 )
#define	R16_GRID_Y	( 8 )
#define	R16_SIZE_X	( 2 )
#define	R16_SIZE_Y	( 1 )

// 大きさ比べの拡縮計算
#define	HEIGHT_SCALE(a)	( FX_Div( 0x100 << FX32_SHIFT, a << FX32_SHIFT ) )

// 重さ比べデータ
#define	HANKEI	( 128 - 72 )

#define	DEFAULT_ROT_PARAM	( 0x4000 )
#define	SIZE_ROT_DISH_CX	( 128 )
#define	SIZE_ROT_DISH_CY	( 104 )

#define	WEIGHT_ANM_FALL_END_PY	( 88 )
#define	WEIGHT_ANM_ICON_PY		( -16 )
#define	WEIGHT_ANM_FALL_SPEED	( 0x400 )

#define	WEIGHT_ROT_MAX	( 0xa00 )
#define	WEIGHT_ROT_MIN	( 0xf600 )

#define	WEIGHT_HERO		( 400 )//( 380 )		// 男主人公の体重
#define	WEIGHT_HEROINE	( 410 )//( 340 )		// 女主人公の体重

// 重さアニメパターン
typedef struct {
	u16	low;
	u16	hi;
}WEIGHT_ANM_PAT;

typedef BOOL (*pWeightAnmFunc)(ZKN2OBJ_WEIGHT_ANM_WORK *);

// 姿比べポケアイコン座標
#define	FORM1_POKEICON_PX	( 48 )
#define	FORM1_POKEICON_PY	( 14 )
#define	FORM1_POKEICON_SY	( 24 )

// 大きさ比べポケモングラフィック表示座標
#define	SIZE_POKEGRA_BG_PX		( 56 )
#define	SIZE_POKEGRA_BG_PY		( 16 )


//============================================================================================
//	プロトタイプ宣言
//============================================================================================
static void ClactResManInit( ZKN2_WORK * wk );
static void ClactResManExit( ZKN2_WORK * wk );
static void ClactDel( ZKN2_WORK * wk, u32 id );
static void ClactDelAll( ZKN2_WORK * wk );

static void PokeIconArcHandleOpen( ZKN2_WORK * wk );
static void PokeIconArcHandleClose( ZKN2_WORK * wk );
static void PokeIconResLoad( ZKN2_WORK * wk, u32 max );
static void PokeIconObjAdd( ZKN2_WORK * wk, u32 startID );

static void PokeGraDummyResLoad( ZKN2_WORK * wk );
static void PokeGraObjAdd( ZKN2_WORK * wk, u32 objID );

static void PokeFootResLoad( ZKN2_WORK * wk );
static void PokeFootAdd( ZKN2_WORK * wk, u32 objID );

static void TypeIconResLoad( ZKN2_WORK * wk );
static void TypeIconAdd( ZKN2_WORK * wk, u32 objID );
static void TypeIconCgxChange( ZKN2_WORK * wk, u32 objID, u32 type );

static void LangIconResLoadMain( ZKN2_WORK * wk );
static void LangIconResLoadSub( ZKN2_WORK * wk );
static void LangIconAdd( ZKN2_WORK * wk, u32 id, const TCATS_OBJECT_ADD_PARAM_S * prm );
static void ListLangIconAdd( ZKN2_WORK * wk );

static void ZukanObjResLoadMain( ZKN2_WORK * wk );
static void ZukanObjResLoadSub( ZKN2_WORK * wk );

static void ListPageResLoad( ZKN2_WORK * wk );
static void ListPageObjAdd( ZKN2_WORK * wk );
static u32 ListBarAnmGet( ZKN2_WORK * wk, BOOL space );

static void SearchPageMainResLoad( ZKN2_WORK * wk );
static void SearchPageMainResFree( ZKN2_WORK * wk );
static void SearchPageMainObjAdd( ZKN2_WORK * wk );

static void DetailListBarAnmChg( ZKN2_WORK * wk, u16 objID, s8 list_max, const u16 * tbl, u32 tbl_max );
static u32 DetailListBarAnmGet( ZKN2_WORK * wk, s8 list_max, const u16 * tbl, u32 tbl_max );

static void PlacePageResLoad( ZKN2_WORK * wk );
static void PlacePageResFree( ZKN2_WORK * wk );
static void PlaceMyFaceMove( ZKN2_WORK * wk );
static void PlacePosAdd( ZKN2_WORK * wk );

static void SizePageResLoad( ZKN2_WORK * wk );
static void SizePageResFree( ZKN2_WORK * wk );
static void SizePokeIconChange( ZKN2_WORK * wk );
static void SizePokeGraChange( ZKN2_WORK * wk );
static void SizeMyGraSet( ZKN2_WORK * wk );
static void PokeGraBgSet(
				ZKN2_WORK * wk, u16 mons, u8 frm, u8 sex, u8 dir );
static void PokeGraBgScroll( ZKN2_WORK * wk, int py, int scale );

static BOOL WeightAnmFunc00( ZKN2OBJ_WEIGHT_ANM_WORK * wk );
static BOOL WeightAnmFunc01( ZKN2OBJ_WEIGHT_ANM_WORK * wk );
static BOOL WeightAnmFunc02( ZKN2OBJ_WEIGHT_ANM_WORK * wk );
static BOOL WeightAnmFunc03( ZKN2OBJ_WEIGHT_ANM_WORK * wk );
static BOOL WeightAnmFunc04( ZKN2OBJ_WEIGHT_ANM_WORK * wk );
static BOOL WeightAnmFunc05( ZKN2OBJ_WEIGHT_ANM_WORK * wk );
static BOOL WeightAnmFunc06( ZKN2OBJ_WEIGHT_ANM_WORK * wk );
static BOOL WeightAnmFunc07( ZKN2OBJ_WEIGHT_ANM_WORK * wk );
static BOOL WeightAnmFunc08( ZKN2OBJ_WEIGHT_ANM_WORK * wk );
static BOOL WeightAnmFunc09( ZKN2OBJ_WEIGHT_ANM_WORK * wk );
static BOOL WeightAnmFunc10( ZKN2OBJ_WEIGHT_ANM_WORK * wk );
static BOOL WeightAnmFunc11( ZKN2OBJ_WEIGHT_ANM_WORK * wk );
static BOOL WeightAnmFunc12( ZKN2OBJ_WEIGHT_ANM_WORK * wk );
static BOOL WeightAnmFunc13( ZKN2OBJ_WEIGHT_ANM_WORK * wk );
static BOOL WeightAnmFunc14( ZKN2OBJ_WEIGHT_ANM_WORK * wk );
static BOOL WeightAnmFunc15( ZKN2OBJ_WEIGHT_ANM_WORK * wk );
static BOOL WeightAnmFunc16( ZKN2OBJ_WEIGHT_ANM_WORK * wk );

static void FormPageObjAdd( ZKN2_WORK * wk );
static void FormPage1PokeGraInit( ZKN2_WORK * wk, u32 pos, u32 pal_mode );
static void FormPage1PokeIconInit( ZKN2_WORK * wk );
static void Form2PagePokeGraChange( ZKN2_WORK * wk, u32 objID, u32 pos, u32 pal_mode );

static void EncExitPosCheck( u32 map, u32 * flg );
static void EncExitObjPut( ZKN2_WORK * wk, u32 flg, u32 objID );
static void EncExitObjVanish( ZKN2_WORK * wk, u32 on, u32 off, u32 objID, u32 pal );
static BOOL EncExitFaceCheck( ZKN2_WORK * wk, u32 start, s16 face_x, s16 face_y );


//============================================================================================
//	グローバル変数
//============================================================================================

// ポケモンアイコン
static const TCATS_OBJECT_ADD_PARAM_S ClaListPokeIconPrm = {
	LIST_POKEICON_PX, LIST_POKEICON_PY, 0,
	0, 10, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
	{ CHR_ID_POKEICON, PAL_ID_POKEICON, CEL_ID_POKEICON, ANM_ID_POKEICON, CLA_H_NONE, CLA_H_NONE },
	3, 0
};

// トップ・リストページのＯＢＪデータ
static const TCATS_OBJECT_ADD_PARAM_S ClaTopPagePrm[] =
{
	{	// モードスイッチ
		128, 128, 0,
		ZKN2OBJ_M_ANM_SWITCH, 10, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// バー
		242, 64, 0,
		ZKN2OBJ_M_ANM_BAR6, 10, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// 上矢印
		242, 12, 0,
		ZKN2OBJ_M_ANM_UP_ON, 20, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// 下矢印
		242, 140, 0,
		ZKN2OBJ_M_ANM_DOWN_ON, 20, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// レール
		LIST_RAIL_PX, LIST_RAIL_PY, 0,
		ZKN2OBJ_M_ANM_RAIL, 20, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// カーソル
		LIST_CURSOR_PX, LIST_CURSOR_PY, 0,
		ZKN2OBJ_M_ANM_LIST_CUR, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// 左矢印
		64, 136, 0,
		ZKN2OBJ_M_ANM_ARROW_L, 10, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 右矢印
		184, 136, 0,
		ZKN2OBJ_M_ANM_ARROW_R, 10, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 言語アイコン
		92, 136, 0,
		0, 10, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_LANGICON_M, PAL_ID_LANGICON_M, CEL_ID_LANGICON_M, ANM_ID_LANGICON_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// ボール（上画面）
		112, 32, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB,
		{ CHR_ID_BALL_S, PAL_ID_ZKNOBJ_S, CEL_ID_BALL_S, ANM_ID_BALL_S, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// なぞポケ
		48, 72, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB,
		{ CHR_ID_ZKNOBJ_S, PAL_ID_ZKNOBJ_S, CEL_ID_ZKNOBJ_S, ANM_ID_ZKNOBJ_S, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// ポケモングラフィック（上画面）
		48, 72, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB,
		{ CHR_ID_POKEGRA1, PAL_ID_POKEGRA1, CEL_ID_POKEGRA, ANM_ID_POKEGRA, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// ポケモングラフィック（上画面）
		48, 72, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB,
		{ CHR_ID_POKEGRA2, PAL_ID_POKEGRA2, CEL_ID_POKEGRA, ANM_ID_POKEGRA, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
};

// タイプアイコン
static const TCATS_OBJECT_ADD_PARAM_S ClaListTypeIconPrm = {
	168, 72, 0,
	0, 10, 0, NNS_G2D_VRAM_TYPE_2DSUB,
	{ CHR_ID_TYPEICON1, PAL_ID_TYPEICON, CEL_ID_TYPEICON, ANM_ID_TYPEICON, CLA_H_NONE, CLA_H_NONE },
	3, 0
};

// 足跡
static const TCATS_OBJECT_ADD_PARAM_S ClaListPokeFootPrm = {
	15*8, 10*8, 0,
	0, 10, 0, NNS_G2D_VRAM_TYPE_2DSUB,
	{ CHR_ID_POKEFOOT, PAL_ID_POKEFOOT, CEL_ID_POKEFOOT, ANM_ID_POKEFOOT, CLA_H_NONE, CLA_H_NONE },
	3, 0
};

// 言語アイコン
static const TCATS_OBJECT_ADD_PARAM_S ClaListLangIconSPrm = {
	0, 8, 0,
	0, 10, 0, NNS_G2D_VRAM_TYPE_2DSUB,
	{ CHR_ID_LANGICON_S, PAL_ID_LANGICON_S, CEL_ID_LANGICON_S, ANM_ID_LANGICON_S, CLA_H_NONE, CLA_H_NONE },
	3, 0
};

// リスト切り替えバーＯＢＪのアニメ番号に対応したポケモン数
static const u16 ListBarAnmMaxTbl[] = {
	15,		// １４キャラ
	45,		// １３キャラ
	90,		// １２キャラ
	135,	// １１キャラ
	180,	// １０キャラ
	225,	// ９キャラ
	270,	// ８キャラ
	315,	// ７キャラ
	360,	// ６キャラ
	405,	// ５キャラ
	450,	// ４キャラ
	495,	// ３キャラ
};

// リスト切り替えバーＯＢＪのアニメ番号に対応したドットサイズ
static const u8 ListBarDotYSiz[] = {
	14*8-2,		// １４キャラ
	13*8-2,		// １３キャラ
	12*8-2,		// １２キャラ
	11*8-2,		// １１キャラ
	10*8-2,		// １０キャラ
	9*8-2,		// ９キャラ
	64-2,		// ８キャラ
	56-2,		// ７キャラ
	48-2,		// ６キャラ
	40-2,		// ５キャラ
	32-2,		// ４キャラ
	24-2,		// ３キャラ
};

// 検索ページのＯＢＪデータ
static const TCATS_OBJECT_ADD_PARAM_S ClaSearchPagePrm[] =
{
	{	// カーソル
		172, 16, 0,
		ZKN2OBJ_M_ANM_CUR_X_11x2, 10, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},

	{	// MAX LA
		18, 60, 0,
		ZKN2OBJ_M_ANM_OMOSA_L, 35, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// MAX RA
		238, 60, 0,
		ZKN2OBJ_M_ANM_OMOSA_R, 35, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// MIN LA
		18, 132, 0,
		ZKN2OBJ_M_ANM_OMOSA_L, 35, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// MIN RA
		238, 132, 0,
		ZKN2OBJ_M_ANM_OMOSA_R, 35, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},

	{	// MAX
		52, 60+8, 0,
		ZKN2OBJ_M_ANM_WEIGHT_MAX, 30, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// MAX NUM1
		52, 56+8, 0,
		ZKN2OBJ_M_ANM_NO_0, 20, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// MAX NUM2
		52, 56+8, 0,
		ZKN2OBJ_M_ANM_NO_0, 20, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// MAX NUM3
		52, 56+8, 0,
		ZKN2OBJ_M_ANM_NO_0, 20, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// MAX NUM4
		52, 56+8, 0,
		ZKN2OBJ_M_ANM_NO_0, 20, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// MIN
		204, 132, 0,
		ZKN2OBJ_M_ANM_WEIGHT_MIN, 30, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// MIN NUM1
		204, 136, 0,
		ZKN2OBJ_M_ANM_NO_0, 20, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// MIN NUM2
		204, 136, 0,
		ZKN2OBJ_M_ANM_NO_0, 20, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// MIN NUM3
		204, 136, 0,
		ZKN2OBJ_M_ANM_NO_0, 20, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// MIN NUM4
		204, 136, 0,
		ZKN2OBJ_M_ANM_NO_0, 20, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},

	{	// モードスイッチ
		128, 128, 0,
		ZKN2OBJ_M_ANM_SWITCH, 10, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// バー
		242, 64, 0,
		ZKN2OBJ_M_ANM_BAR6, 10, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// 上矢印
		242, 12, 0,
		ZKN2OBJ_M_ANM_UP_ON, 20, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// 下矢印
		242, 140, 0,
		ZKN2OBJ_M_ANM_DOWN_ON, 20, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// レール
		LIST_RAIL_PX, LIST_RAIL_PY, 0,
		ZKN2OBJ_M_ANM_RAIL, 20, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// 左矢印
		64, 136, 0,
		ZKN2OBJ_M_ANM_ARROW_L, 10, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 右矢印
		184, 136, 0,
		ZKN2OBJ_M_ANM_ARROW_R, 10, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 言語アイコン
		92, 136, 0,
		0, 10, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_LANGICON_M, PAL_ID_LANGICON_M, CEL_ID_LANGICON_M, ANM_ID_LANGICON_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// リストアイコン
		LIST_POKEICON_PX, LIST_POKEICON_PY, 0,
		ZKN2OBJ_M_ANM_LIST, 20, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},

	{	// ヤドン
		128, 80, 0,
		0, 20, 0, NNS_G2D_VRAM_TYPE_2DSUB,
		{ CHR_ID_SEARCH_S, PAL_ID_SEARCH_S, CEL_ID_SEARCH_S, ANM_ID_SEARCH_S, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// 検索ゲージ
		128, 80, 0,
		0, 10, 0, NNS_G2D_VRAM_TYPE_2DSUB,
		{ CHR_ID_SEARCH_S, PAL_ID_SEARCH_S, CEL_ID_SEARCH_S, ANM_ID_SEARCH_S, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
};

// 姿アイコンＯＢＪデータ（メイン画面）
static const TCATS_OBJECT_ADD_PARAM_S ClaSearchFormPrm = {
	0, 0, 0,
	0, 20, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
	{ CHR_ID_SEARCH_FORM, PAL_ID_SEARCH_FORM, CEL_ID_SEARCH_FORM, ANM_ID_SEARCH_FORM, CLA_H_NONE, CLA_H_NONE },
	0, 0
};
// 姿アイコンＯＢＪデータ（サブ画面）
static const TCATS_OBJECT_ADD_PARAM_S ClaSearchFormSPrm = {
	224, 72+24*8, 0,
	0, 20, 0, NNS_G2D_VRAM_TYPE_2DSUB,
	{ CHR_ID_SEARCH_FORM_S, PAL_ID_SEARCH_FORM_S, CEL_ID_SEARCH_FORM_S, ANM_ID_SEARCH_FORM_S, CLA_H_NONE, CLA_H_NONE },
	1, 0
};


// 詳細画面共通ＯＢＪデータ
static const TCATS_OBJECT_ADD_PARAM_S ClaDetailPagePrm = {
	DETAIL_CURSOR_PX, DETAIL_CURSOR_PY, 0,
	ZKN2OBJ_M_ANM_BTN_CUR2, 10, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
	{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
	0, 0
};

// 詳細・姿ページのＯＢＪデータ
static const TCATS_OBJECT_ADD_PARAM_S ClaFormPagePrm[] =
{
	{	// 左ポケモングラフィック（上画面）
		FORM1_POKE_L_PX, FORM1_POKE_L_PY, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB,
		{ CHR_ID_POKEGRA1, PAL_ID_POKEGRA1, CEL_ID_POKEGRA, ANM_ID_POKEGRA, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 右ポケモングラフィック（上画面）
		FORM1_POKE_R_PX, FORM1_POKE_R_PY, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB,
		{ CHR_ID_POKEGRA2, PAL_ID_POKEGRA2, CEL_ID_POKEGRA, ANM_ID_POKEGRA, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 左ポケモングラフィック（上画面）
		FORM1_POKE_L_PX, FORM1_POKE_L_PY, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB,
		{ CHR_ID_POKEGRA3, PAL_ID_POKEGRA3, CEL_ID_POKEGRA, ANM_ID_POKEGRA, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 右ポケモングラフィック（上画面）
		FORM1_POKE_R_PX, FORM1_POKE_R_PY, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB,
		{ CHR_ID_POKEGRA4, PAL_ID_POKEGRA4, CEL_ID_POKEGRA, ANM_ID_POKEGRA, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},

	{	// バー
		242, 64, 0,
		ZKN2OBJ_M_ANM_BAR4, 10, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 上矢印
		242, 12, 0,
		ZKN2OBJ_M_ANM_UP_ON, 20, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 下矢印
		242, 116, 0,
		ZKN2OBJ_M_ANM_DOWN_ON, 20, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// レール
		FORMLIST_RAIL_PX, FORMLIST_RAIL_PY, 0,
		ZKN2OBJ_M_ANM_RAIL_SHORT, 20, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},

	{	// 上矢印・左
		64, 56, 0,
		ZKN2OBJ_M_ANM_ARROW_U, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 下矢印・左
		64, 128, 0,
		ZKN2OBJ_M_ANM_ARROW_D, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 上矢印・右
		192, 56, 0,
		ZKN2OBJ_M_ANM_ARROW_U, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 下矢印・右
		192, 128, 0,
		ZKN2OBJ_M_ANM_ARROW_D, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// カーソル
		FORM2_POKEICON_LPX, FORM2_POKEICON_LPY, 0,
		ZKN2OBJ_M_ANM_CUR_SUGATA, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},

	{	// ポケモンアイコン１
		0, 0, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_POKEICON, PAL_ID_POKEICON, CEL_ID_POKEICON, ANM_ID_POKEICON, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// ポケモンアイコン２
		0, 0, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_POKEICON+1, PAL_ID_POKEICON, CEL_ID_POKEICON, ANM_ID_POKEICON, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// ポケモンアイコン３
		0, 0, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_POKEICON+2, PAL_ID_POKEICON, CEL_ID_POKEICON, ANM_ID_POKEICON, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// ポケモンアイコン４
		0, 0, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_POKEICON+3, PAL_ID_POKEICON, CEL_ID_POKEICON, ANM_ID_POKEICON, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// ポケモンアイコン５
		0, 0, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_POKEICON+4, PAL_ID_POKEICON, CEL_ID_POKEICON, ANM_ID_POKEICON, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
	{	// ポケモンアイコン６
		0, 0, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_POKEICON+5, PAL_ID_POKEICON, CEL_ID_POKEICON, ANM_ID_POKEICON, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},
};

// フォルムリスト切り替えバーＯＢＪのアニメ番号に対応したフォルム数
static const u16 FormListBarAnmMaxTbl[] = {
	1,		// １１キャラ
	4,		// １０キャラ
	7,		// ９キャラ
	10,		// ８キャラ
	13,		// ７キャラ
	16,		// ６キャラ
	20,		// ５キャラ
	24,		// ４キャラ
	28,		// ３キャラ
};

// フォルムリスト切り替えバーＯＢＪのアニメ番号に対応したドットサイズ
static const u8 FormListBarDotYSiz[] = {
	11*8-2,		// １１キャラ
	10*8-2,		// １０キャラ
	9*8-2,		// ９キャラ
	64-2,		// ８キャラ
	56-2,		// ７キャラ
	48-2,		// ６キャラ
	40-2,		// ５キャラ
	32-2,		// ４キャラ
	24-2,		// ３キャラ
};

// 分布リスト切り替えバーＯＢＪのアニメ番号に対応した地名数
static const u16 PlaceListBarAnmMaxTbl[] = {
	1,		// １１キャラ
	4,		// １０キャラ
	7,		// ９キャラ
	10,		// ８キャラ
	13,		// ７キャラ
	16,		// ６キャラ
	20,		// ５キャラ
	24,		// ４キャラ
	255,	// ３キャラ
};

// 分布リスト切り替えバーＯＢＪのアニメ番号に対応したドットサイズ
static const u8 PlaceListBarDotYSiz[] = {
	11*8-2,		// １１キャラ
	10*8-2,		// １０キャラ
	9*8-2,		// ９キャラ
	64-2,		// ８キャラ
	56-2,		// ７キャラ
	48-2,		// ６キャラ
	40-2,		// ５キャラ
	32-2,		// ４キャラ
	24-2,		// ３キャラ
};

// 詳細・大きさページのＯＢＪデータ
static const TCATS_OBJECT_ADD_PARAM_S ClaSizePagePrm[] =
{
	{	// 主人公シルエット
		184, 112, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB,
		{ CHR_ID_MYSILHOUETTE, PAL_ID_MYICON_S, CEL_ID_MYSILHOUETTE, ANM_ID_MYSILHOUETTE, CLA_H_NONE, CLA_H_NONE },
		1, 0
	},
	{	// ポケモンアイコン（下画面）
//		72, 88, 0,
		72, -16, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_POKEICON, PAL_ID_POKEICON, CEL_ID_POKEICON, ANM_ID_POKEICON, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// ポケモンアイコン（上画面）
		72, 80, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB,
		{ CHR_ID_POKEICON+1, PAL_ID_POKEICON_S, CEL_ID_POKEICON, ANM_ID_POKEICON, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 主人公アイコン（下画面）
		184, -16, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_MYICON_M, PAL_ID_MYICON_M, CEL_ID_MYICON, ANM_ID_MYICON, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 主人公アイコン（上画面）
		0, 0, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB,
		{ CHR_ID_MYICON_S, PAL_ID_MYICON_S, CEL_ID_MYICON, ANM_ID_MYICON, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 天秤・台
		128, 104, 0,
		ZKN2OBJ_M_ANM_WEIGHT3, 10, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		1, 0
	},
	{	// 天秤・板
		128, 104, 0,
		ZKN2OBJ_M_ANM_WEIGHT1, 15, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		1, 0
	},
	{	// 天秤・皿左
		72, 104, 0,
		ZKN2OBJ_M_ANM_WEIGHT2, 12, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		1, 0
	},
	{	// 天秤・皿右
		184, 104, 0,
		ZKN2OBJ_M_ANM_WEIGHT2, 12, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		1, 0
	},
};

// 詳細・分布ページのＯＢＪデータ
static const TCATS_OBJECT_ADD_PARAM_S ClaEncountPagePrm[] =
{
	{	// ポケモンアイコン（上画面）
		36, 112, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB,
		{ CHR_ID_POKEICON, PAL_ID_POKEICON_S, CEL_ID_POKEICON, ANM_ID_POKEICON, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},

	{	// 自分の位置
		128, 128, 0,
		0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB,
		{ CHR_ID_MYICON_S, PAL_ID_MYICON_S, CEL_ID_MYICON, ANM_ID_MYICON, CLA_H_NONE, CLA_H_NONE },
		3, 0
	},

	{	// 時間
		32, 108, 0,
		ZKN2OBJ_M_ANM_TIME, 10, 3, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 時間カーソル
		PLACE_TIME_CURSOR_PX, PLACE_TIME_CURSOR_PY, 0,
		ZKN2OBJ_M_ANM_TIME_CUR, 9, 0, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// バー
		242, 64+32, 0,
		ZKN2OBJ_M_ANM_BAR4, 10, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 上矢印
		242, 12+32, 0,
		ZKN2OBJ_M_ANM_UP_ON, 20, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// 下矢印
		242, 116+32, 0,
		ZKN2OBJ_M_ANM_DOWN_ON, 20, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
	{	// レール
		PLACELIST_RAIL_PX, PLACELIST_RAIL_PY, 0,
		ZKN2OBJ_M_ANM_RAIL_SHORT, 20, 1, NNS_G2D_VRAM_TYPE_2DMAIN,
		{ CHR_ID_ZKNOBJ_M, PAL_ID_ZKNOBJ_M, CEL_ID_ZKNOBJ_M, ANM_ID_ZKNOBJ_M, CLA_H_NONE, CLA_H_NONE },
		0, 0
	},
};

// 詳細・分布ページの出現場所のＯＢＪデータ
static const TCATS_OBJECT_ADD_PARAM_S ClaEncPosPrm = {
	128+64, 128, 0,
	0, 20, 0, NNS_G2D_VRAM_TYPE_2DSUB,
	{ CHR_ID_POS_S, PAL_ID_POS_S, CEL_ID_POS, ANM_ID_POS, CLA_H_NONE, CLA_H_NONE },
	3, 0
};

// 分布場所サイズ
static const u8 EncAreObjSize[][2] =
{	// x, y
	{  8,  8 },		// PLACE_POS_ANM_1x1
	{ 16,  8 },		// PLACE_POS_ANM_2x1
	{ 24,  8 },		// PLACE_POS_ANM_3x1
	{ 32,  8 },		// PLACE_POS_ANM_4x1
	{ 40,  8 },		// PLACE_POS_ANM_5x1
	{ 48,  8 },		// PLACE_POS_ANM_6x1
	{  8, 16 },		// PLACE_POS_ANM_1x2
	{  8, 24 },		// PLACE_POS_ANM_1x3
	{  8, 32 },		// PLACE_POS_ANM_1x4
	{  8, 40 },		// PLACE_POS_ANM_1x5
	{ 16, 16 },		// PLACE_POS_ANM_2x2
	{ 24, 16 },		// PLACE_POS_ANM_3x2
};


// 重さアニメデータテーブル
static const WEIGHT_ANM_PAT WeightAnmPatTbl[] =
{
	{ 0, 0 },			// 00
	{ 1, 1 },			// 01
	{ 2, 2 },			// 02
	{ 3, 3 },			// 03
	{ 4, 4 },			// 04
	{ 5, 5 },			// 05
	{ 6, 6 },			// 06
	{ 7, 7 },			// 07
	{ 8, 15 },			// 08
	{ 16, 30 },			// 09
	{ 31, 50 },			// 10
	{ 51, 75 },			// 11
	{ 76, 105 },		// 12
	{ 106, 155 },		// 13
	{ 156, 235 },		// 14
	{ 236, 350 },		// 15
	{ 351, 65535 },		// 16
};

// 重さアニメ関数テーブル
static const pWeightAnmFunc WeightAnmFuncTbl[] = {
	WeightAnmFunc00,
	WeightAnmFunc01,
	WeightAnmFunc02,
	WeightAnmFunc03,
	WeightAnmFunc04,
	WeightAnmFunc05,
	WeightAnmFunc06,
	WeightAnmFunc07,
	WeightAnmFunc08,
	WeightAnmFunc09,
	WeightAnmFunc10,
	WeightAnmFunc11,
	WeightAnmFunc12,
	WeightAnmFunc13,
	WeightAnmFunc14,
	WeightAnmFunc15,
	WeightAnmFunc16,
};

// OBJじゃないけど。。。
// 大きさ比べポケモングラフィックBGスクリーンテーブル
static const u8 PokeGraScrn[] = {
	  1,   2,   3,   4,   5,   6,   7,   8,  65,  66,
	  9,  10,  11,  12,  13,  14,  15,  16,  67,  68,
	 17,  18,  19,  20,  21,  22,  23,  24,  69,  70,
	 25,  26,  27,  28,  29,  30,  31,  32,  71,  72,
	 33,  34,  35,  36,  37,  38,  39,  40,  73,  74,
	 41,  42,  43,  44,  45,  46,  47,  48,  75,  76,
	 49,  50,  51,  52,  53,  54,  55,  56,  77,  78,
	 57,  58,  59,  60,  61,  62,  63,  64,  79,  80,
	 81,  82,  83,  84,  89,  90,  91,  92,  97,  98,
	 85,  86,  87,  88,  93,  94,  95,  96,  99, 100
};



//--------------------------------------------------------------------------------------------
/**
 * セルアクター初期化
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_Init( ZKN2_WORK * wk )
{
	GF_Disp_GX_VisibleControl( GX_PLANEMASK_OBJ, VISIBLE_ON );		// MAIN DISP OBJ ON
	GF_Disp_GXS_VisibleControl( GX_PLANEMASK_OBJ, VISIBLE_ON );		// SUB DISP OBJ ON

	PokeIconArcHandleOpen( wk );

	ClactResManInit( wk );
}

//--------------------------------------------------------------------------------------------
/**
 * セルアクター解放
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_Exit( ZKN2_WORK * wk )
{
	ClactDelAll( wk );
	ClactResManExit( wk );

	PokeIconArcHandleClose( wk );
}

//--------------------------------------------------------------------------------------------
/**
 * セルアクターアニメメイン
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_AnmMain( ZKN2_WORK * wk )
{
	u32	i;

	for( i=0; i<ZKN2_OBJ_MAX; i++ ){
		if( wk->cap[i] != NULL ){
			CATS_ObjectUpdateCap( wk->cap[i] );
		}
	}
}

//--------------------------------------------------------------------------------------------
/**
 * リソースマネージャー初期化
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void ClactResManInit( ZKN2_WORK * wk )
{
	wk->csp = CATS_AllocMemory( HEAPID_ZUKAN );
	wk->crp = CATS_ResourceCreate( wk->csp );

	{
		TCATS_OAM_INIT	coi = {
			0, 128,
			0, 32,
			0, 128,
			0, 32,
		};

		TCATS_CHAR_MANAGER_MAKE ccmm = {
//			ZKN2_OBJ_MAX,
			1024,
			1024*64,
			1024*16,
			GX_OBJVRAMMODE_CHAR_1D_64K,
			GX_OBJVRAMMODE_CHAR_1D_64K
		};
		CATS_SystemInit( wk->csp, &coi, &ccmm, 32 );
	}
	{
		TCATS_RESOURCE_NUM_LIST	crnl = {
			CHR_ID_MAX, PAL_ID_MAX, CEL_ID_MAX, ANM_ID_MAX, 0, 0
		};
//		CATS_ClactSetInit( wk->csp, wk->crp, BOX2OBJ_ID_MAX+FNTOAM_CHR_MAX );
		CATS_ClactSetInit( wk->csp, wk->crp, ZKN2_OBJ_MAX );
		CATS_ResourceManagerInit( wk->csp, wk->crp, &crnl );
	}
	{
		CLACT_U_EASYRENDER_DATA * renddata = CATS_EasyRenderGet( wk->csp );
		CLACT_U_SetSubSurfaceMatrix( renddata, 0, ZKN2_SUB_ACTOR_DISTANCE );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * リソースマネージャー解放
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void ClactResManExit( ZKN2_WORK * wk )
{
	CATS_ResourceDestructor_S( wk->csp, wk->crp );
	CATS_FreeMemory( wk->csp );
}

//--------------------------------------------------------------------------------------------
/**
 * セルアクター削除
 *
 * @param	wk		図鑑画面ワーク
 * @param	id		OBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void ClactDel( ZKN2_WORK * wk, u32 id )
{
	if( wk->cap[id] != NULL ){
		CATS_ActorPointerDelete_S( wk->cap[id] );
		wk->cap[id] = NULL;
	}
}

//--------------------------------------------------------------------------------------------
/**
 * セルアクター全削除
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void ClactDelAll( ZKN2_WORK * wk )
{
	u32	i;

	for( i=0; i<ZKN2_OBJ_MAX; i++ ){
		ClactDel( wk, i );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * ＯＢＪに割り当てられているキャラデータを書き換える
 *
 * @param	wk		図鑑画面ワーク
 * @param	id		OBJ ID
 * @param	buf		キャラデータ
 * @param	siz		キャラサイズ
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void CgxChangeTrans( ZKN2_WORK * wk, u32 id, u8 * buf, u32 siz, NNS_G2D_VRAM_TYPE vram )
{
	NNSG2dImageProxy * ipc;
	u32	cgx;

	ipc = CLACT_ImageProxyGet( wk->cap[id]->act );
	cgx = NNS_G2dGetImageLocation( ipc, vram );

	DC_FlushRange( buf, siz );
	if( vram == NNS_G2D_VRAM_TYPE_2DMAIN ){
		GX_LoadOBJ( buf, cgx, siz );
	}else{
		GXS_LoadOBJ( buf, cgx, siz );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * セルアクター半透明設定
 *
 * @param	wk		図鑑画面ワーク
 * @param	id		OBJ ID
 * @param	flg		ON/OFFフラグ
 *
 * @return	none
 *
 * @li	flg : TRUE = ON, FALSE = OFF
 */
//--------------------------------------------------------------------------------------------
static void BlendModeSet( ZKN2_WORK * wk, u32 id, BOOL flg )
{
	if( flg == TRUE ){
		CATS_ObjectObjModeSetCap( wk->cap[id], GX_OAM_MODE_XLU );
	}else{
		CATS_ObjectObjModeSetCap( wk->cap[id], GX_OAM_MODE_NORMAL );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * セルアクターアニメ変更
 *
 * @param	wk		図鑑画面ワーク
 * @param	id		OBJ ID
 * @param	anm		アニメ番号
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_AnmSet( ZKN2_WORK * wk, u32 id, u32 anm )
{
	CATS_ObjectAnimeFrameSetCap( wk->cap[id], 0 );
	CATS_ObjectAnimeSeqSetCap( wk->cap[id], anm );
}

//--------------------------------------------------------------------------------------------
/**
 * セルアクターアニメ状態取得
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	BOOL
 */
//--------------------------------------------------------------------------------------------
BOOL ZKN2OBJ_AnmGet( ZKN2_WORK * wk, u32 id )
{
	return CATS_ObjectAnimeActiveCheckCap( wk->cap[id] );
}

//--------------------------------------------------------------------------------------------
/**
 * セルアクター表示切り替え
 *
 * @param	wk		図鑑画面ワーク
 * @param	id		OBJ ID
 * @param	flg		表示フラグ
 *
 * @return	none
 *
 * @li	flg = TRUE : 表示
 * @li	flg = FALSE : 非表示
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_Vanish( ZKN2_WORK * wk, u32 id, BOOL flg )
{
	if( flg == TRUE ){
		CATS_ObjectEnableCap( wk->cap[id], ACT_ON );
	}else{
		CATS_ObjectEnableCap( wk->cap[id], ACT_OFF );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * OBJ追加
 *
 * @param	wk		図鑑画面ワーク
 * @param	prm		ＯＢＪデータ
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static CATS_ACT_PTR ObjAdd( ZKN2_WORK * wk, const TCATS_OBJECT_ADD_PARAM_S * prm )
{
	if( prm->d_area == NNS_G2D_VRAM_TYPE_2DMAIN ){
		return CATS_ObjectAdd_S( wk->csp, wk->crp, prm );
	}
	return CATS_ObjectAdd_S_SubDistance( wk->csp, wk->crp, prm, ZKN2_SUB_ACTOR_DISTANCE );
}

//--------------------------------------------------------------------------------------------
/**
 * OBJ移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	id		OBJ番号
 * @param	mx		Ｘ移動値
 * @param	my		Ｙ移動値
 * @param	disp	表示画面
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void ObjMove( ZKN2_WORK * wk, u32 id, s16 mx, s16 my, u32 disp )
{
	s16	x, y;

	if( disp == OBJ_PUT_DISP_MAIN ){
		CATS_ObjectPosGetCap( wk->cap[id], &x, &y );
		CATS_ObjectPosSetCap( wk->cap[id], x+mx, y+my );
	}else{
		CATS_ObjectPosGetCap_SubSurface( wk->cap[id], &x, &y, ZKN2_SUB_ACTOR_DISTANCE );
		CATS_ObjectPosSetCap_SubSurface( wk->cap[id], x+mx, y+my, ZKN2_SUB_ACTOR_DISTANCE );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * OBJ位置設定
 *
 * @param	wk		図鑑画面ワーク
 * @param	id		OBJ番号
 * @param	px		Ｘ座標
 * @param	py		Ｙ座標
 * @param	disp	表示画面
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void ObjPosSet( ZKN2_WORK * wk, u32 id, s16 px, s16 py, u32 disp )
{
	if( disp == OBJ_PUT_DISP_MAIN ){
		CATS_ObjectPosSetCap( wk->cap[id], px, py );
	}else{
		CATS_ObjectPosSetCap_SubSurface( wk->cap[id], px, py, ZKN2_SUB_ACTOR_DISTANCE );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * OBJ位置取得
 *
 * @param	wk		図鑑画面ワーク
 * @param	id		OBJ番号
 * @param	px		Ｘ座標
 * @param	py		Ｙ座標
 * @param	disp	表示画面
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void ObjPosGet( ZKN2_WORK * wk, u32 id, s16 * x, s16 * y, u32 disp )
{
	if( disp == OBJ_PUT_DISP_MAIN ){
		CATS_ObjectPosGetCap( wk->cap[id], x, y );
	}else{
		CATS_ObjectPosGetCap_SubSurface( wk->cap[id], x, y, ZKN2_SUB_ACTOR_DISTANCE );
	}
}


//============================================================================================
//	ポケモンアイコン
//============================================================================================

//--------------------------------------------------------------------------------------------
/**
 * ポケモンアイコンのアーカイブハンドル取得
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeIconArcHandleOpen( ZKN2_WORK * wk )
{
	wk->pokeicon_ah = ArchiveDataHandleOpen( ARC_POKEICON, HEAPID_ZUKAN );
}

//--------------------------------------------------------------------------------------------
/**
 * ポケモンアイコンのアーカイブハンドル破棄
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeIconArcHandleClose( ZKN2_WORK * wk )
{
	ArchiveDataHandleClose( wk->pokeicon_ah );
}

//--------------------------------------------------------------------------------------------
/**
 * ポケモンアイコンリソース読み込み
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 *
 *	キャラはダミー
 */
//--------------------------------------------------------------------------------------------
static void PokeIconResLoad( ZKN2_WORK * wk, u32 max )
{
	u32	i;

	for( i=0; i<max; i++ ){
		CATS_LoadResourceCharArcH(
			wk->csp, wk->crp, wk->graphic_ah,
			NARC_zukan_gra_pokeicon_dmy_lz_NCGR,
			1, NNS_G2D_VRAM_TYPE_2DMAIN, CHR_ID_POKEICON+i );
	}

	CATS_LoadResourcePlttWorkArcH(
		wk->pfd, FADE_MAIN_OBJ,
		wk->csp, wk->crp,
		wk->pokeicon_ah, PokeIconPalArcIndexGet(), 0,
		PALSIZ_POKEICON, NNS_G2D_VRAM_TYPE_2DMAIN, PAL_ID_POKEICON );

	CATS_LoadResourceCellArcH(
		wk->csp, wk->crp,
		wk->pokeicon_ah, PokeIcon64kCellArcIndexGet(), 0, CEL_ID_POKEICON );
	CATS_LoadResourceCellAnmArcH(
		wk->csp, wk->crp,
		wk->pokeicon_ah, PokeIcon64kCellAnmArcIndexGet(), 0, ANM_ID_POKEICON );
}

//--------------------------------------------------------------------------------------------
/**
 * ポケモンアイコンリソース削除
 *
 * @param	wk		図鑑画面ワーク
 * @param	max		キャラ数
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeIconResFree( ZKN2_WORK * wk, u32 max )
{
	u32	i;

	for( i=0; i<max; i++ ){
		CATS_FreeResourceChar( wk->crp, CHR_ID_POKEICON+i );
	}
	CATS_FreeResourcePltt( wk->crp, PAL_ID_POKEICON );
	CATS_FreeResourceCell( wk->crp, CEL_ID_POKEICON );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_POKEICON );
}


//--------------------------------------------------------------------------------------------
/**
 * ポケモンアイコンOBJ追加
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
*/
//--------------------------------------------------------------------------------------------
static void PokeIconObjAdd( ZKN2_WORK * wk, u32 startID )
{
	TCATS_OBJECT_ADD_PARAM_S	prm;
	u32	i;

	for( i=0; i<ZKN2_POKEICON_ADD_MAX*2; i++ ){
		prm = ClaListPokeIconPrm;
		prm.id[0] = CHR_ID_POKEICON + i;

		wk->cap[startID+i] = CATS_ObjectAdd_S( wk->csp, wk->crp, &prm );
	}
}


//--------------------------------------------------------------------------------------------
/**
 * ポケモンアイコンキャラデータ読み込み
 *
 * @param	wk		図鑑画面ワーク
 * @param	mons	ポケモン番号
 * @param	frm		フォルム番号
 * @param	chr		NNSG2dCharacterData
 *
 * @return	buf
 */
//--------------------------------------------------------------------------------------------
static void * PokeIconCgxLoad( ZKN2_WORK * wk, u32 mons, u32 frm, NNSG2dCharacterData ** chr )
{
	void * buf;
	u32	arc;

	arc = PokeIconCgxArcIndexGetZUKAN( mons, 0, frm );
	buf = ArcUtil_HDL_CharDataGet( wk->pokeicon_ah, arc, 0, chr, HEAPID_ZUKAN );

	return buf;
}

//--------------------------------------------------------------------------------------------
/**
 * ポケモンアイコンのキャラデータを変更
 *
 * @param	wk		図鑑画面ワーク
 * @param	buf		キャラデータバッファ
 * @param	id		OBJ ID
 * @param	pal		パレット番号
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeIconChangeCore( ZKN2_WORK * wk, void * buf, u32 id, u32 pal )
{
	u32	pal_ofs = CATS_PlttID_NoGet( wk->crp, PAL_ID_POKEICON, NNS_G2D_VRAM_TYPE_2DMAIN );

	CgxChangeTrans( wk, id, buf, ZKN2_POKEICON_CGX_SIZE, NNS_G2D_VRAM_TYPE_2DMAIN );

	CATS_ObjectPaletteSetCap( wk->cap[id], pal_ofs + pal );
}

//--------------------------------------------------------------------------------------------
/**
 * ポケモンアイコンのキャラデータを変更
 *
 * @param	wk		図鑑画面ワーク
 * @param	mons	ポケモン番号
 * @param	frm		フォルム番号
 * @param	id		OBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeIconChange( ZKN2_WORK * wk, u32 mons, u32 frm, u32 id )
{
	NNSG2dCharacterData * chr;
	void * buf;

	buf = PokeIconCgxLoad( wk, mons, frm, &chr );

	PokeIconChangeCore( wk, chr->pRawData, id, PokeIconPalNumGetZUKAN( mons, frm, 0 ) );

	sys_FreeMemoryEz( buf );
}

//--------------------------------------------------------------------------------------------
/**
 * ポケモンアイコンのキャラデータを変更（サブ画面用）
 *
 * @param	wk		図鑑画面ワーク
 * @param	mons	ポケモン番号
 * @param	frm		フォルム番号
 * @param	id		OBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeIconChangeSub( ZKN2_WORK * wk, u32 mons, u32 frm, u32 id )
{
	NNSG2dCharacterData * chr;
	void * buf;
	u32	pal;

	buf = PokeIconCgxLoad( wk, mons, frm, &chr );

	CgxChangeTrans(
		wk, id, chr->pRawData, ZKN2_POKEICON_CGX_SIZE, NNS_G2D_VRAM_TYPE_2DSUB );

	pal = CATS_PlttID_NoGet( wk->crp, PAL_ID_POKEICON_S, NNS_G2D_VRAM_TYPE_2DSUB );

	CATS_ObjectPaletteSetCap( wk->cap[id], pal + PokeIconPalNumGetZUKAN(mons,frm,0) );

	sys_FreeMemoryEz( buf );
}

//--------------------------------------------------------------------------------------------
/**
 * ポケモンアイコン変更
 *
 * @param	wk		図鑑画面ワーク
 * @param	pos		ポケモン位置
 * @param	id		OBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_PokeIconChange( ZKN2_WORK * wk, u32 pos, u32 id )
{
	u32	frm;

	CATS_ObjectEnableCap( wk->cap[id], ACT_OFF );

	if( wk->list_put[pos].mons == 0 ){
		return;
	}

	frm = ZukanWork_GetPokeForm( wk->dat->zukan_work, wk->list_put[pos].mons, 0 );
	if( wk->list_put[pos].mons == MONSNO_PITYUU ){
		if( frm == 2 ){
			frm = 1;
		}else{
			frm = 0;
		}
	}

	PokeIconChange( wk, wk->list_put[pos].mons, frm, id );
	CATS_ObjectEnableCap( wk->cap[id], ACT_ON );

	if( wk->list_put[pos].type == ZKN2LIST_REGTYPE_SEE ){
		BlendModeSet( wk, id, TRUE );
	}else{
		BlendModeSet( wk, id, FALSE );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * リストページ：ポケモンアイコン初期化
 *
 * @param	wk			図鑑画面ワーク
 * @param	startID		開始OBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_PokeIconListInit( ZKN2_WORK * wk, u32 startID )
{
	u16	i, id;

	for( i=0; i<ZKN2_POKEICON_ADD_MAX; i++ ){
		id = startID + i + ZKN2_POKEICON_ADD_MAX * (wk->icon_swap^1);
		CATS_ObjectEnableCap( wk->cap[id], ACT_OFF );
	}

	for( i=0; i<ZKN2_POKEICON_ADD_MAX; i++ ){
		id = startID + i + ZKN2_POKEICON_ADD_MAX * wk->icon_swap;
		ZKN2OBJ_PokeIconChange( wk, wk->list_scr*ZKN2_POKEICON_SEL_MAX+i, id );
		CATS_ObjectPosSetCap(
			wk->cap[id],
			LIST_POKEICON_PX + ( i % ZKN2_POKEICON_PUT_H_MAX * LIST_POKEICON_SX ),
			LIST_POKEICON_PY + ( i / ZKN2_POKEICON_PUT_H_MAX * LIST_POKEICON_SY ) );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * リストページ：ポケモンアイコンスクロール（上方向）
 *
 * @param	wk			図鑑画面ワーク
 * @param	startID		開始OBJ ID
 * @param	mv			移動量
 * @param	cnt			スクロールカウンタ（グリッド単位）
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_PokeIconScroll_U( ZKN2_WORK * wk, u32 startID, s8 mv, u8 cnt )
{
	u16	i, j;
	s16	x, y;
	u32	id;

	j = 0;
	for( i=0; i<ZKN2_POKEICON_ADD_MAX; i++ ){
		id = startID + i + ZKN2_POKEICON_ADD_MAX * wk->icon_swap;
		CATS_ObjectPosGetCap( wk->cap[id], &x, &y );
		if( y == LIST_POKEICON_PY + LIST_CURSOR_SY * ZKN2_POKEICON_PUT_V_MAX ){
			y = LIST_POKEICON_PY - LIST_CURSOR_SY;
			ZKN2OBJ_PokeIconChange(
				wk,
				wk->list_scr*ZKN2_POKEICON_SEL_MAX-(cnt+1)*ZKN2_POKEICON_PUT_H_MAX+j,
				id );
			j++;
		}
		y += mv;
		CATS_ObjectPosSetCap( wk->cap[id], x, y );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * リストページ：ポケモンアイコンスクロール（下方向）
 *
 * @param	wk			図鑑画面ワーク
 * @param	startID		開始OBJ ID
 * @param	mv			移動量
 * @param	cnt			スクロールカウンタ（グリッド単位）
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_PokeIconScroll_D( ZKN2_WORK * wk, u32 startID, s8 mv, u8 cnt )
{
	u16	i, j;
	s16	x, y;
	u32	id;

	j = 0;
	for( i=0; i<ZKN2_POKEICON_ADD_MAX; i++ ){
		id = startID + i + ZKN2_POKEICON_ADD_MAX * wk->icon_swap;
		CATS_ObjectPosGetCap( wk->cap[id], &x, &y );
		if(	y == LIST_POKEICON_PY - LIST_CURSOR_SY ){
			y = LIST_POKEICON_PY + LIST_CURSOR_SY * ZKN2_POKEICON_PUT_V_MAX;
			ZKN2OBJ_PokeIconChange(
				wk,
				wk->list_scr*ZKN2_POKEICON_SEL_MAX+(cnt+5)*ZKN2_POKEICON_PUT_H_MAX+j,
				id );
			j++;
		}
		y += mv;
		CATS_ObjectPosSetCap( wk->cap[id], x, y );
	}
}

//============================================================================================
//	ポケモングラフィック
//============================================================================================

//--------------------------------------------------------------------------------------------
/**
 * ポケモングラフィックリソース読み込み
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeGraDummyResLoad( ZKN2_WORK * wk )
{
	CATS_LoadResourceCharArc(
		wk->csp, wk->crp,
		ARC_BATT_OBJ, POKE_OAM_NCGR, 0, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_POKEGRA1 );
	CATS_LoadResourceCharArc(
		wk->csp, wk->crp,
		ARC_BATT_OBJ, POKE_OAM_NCGR, 0, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_POKEGRA2 );

	CATS_LoadResourcePlttWorkArc(
		wk->pfd, FADE_SUB_OBJ,
		wk->csp, wk->crp,
		ARC_BATT_OBJ, POKE_OAM_NCLR,
		0, PALSIZ_POKEGRA1, NNS_G2D_VRAM_TYPE_2DSUB, PAL_ID_POKEGRA1 );

	CATS_LoadResourcePlttWorkArc(
		wk->pfd, FADE_SUB_OBJ,
		wk->csp, wk->crp,
		ARC_BATT_OBJ, POKE_OAM_NCLR,
		0, PALSIZ_POKEGRA1, NNS_G2D_VRAM_TYPE_2DSUB, PAL_ID_POKEGRA2 );

	CATS_LoadResourceCellArc(
		wk->csp, wk->crp, ARC_BATT_OBJ, POKE_OAM_NCER, 0, CEL_ID_POKEGRA );
	CATS_LoadResourceCellAnmArc(
		wk->csp, wk->crp, ARC_BATT_OBJ, POKE_OAM_NANR, 0, ANM_ID_POKEGRA );
}

//--------------------------------------------------------------------------------------------
/**
 * ポケモングラフィックリソース解放
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeGraDummyResFree( ZKN2_WORK * wk )
{
	CATS_FreeResourceChar( wk->crp, CHR_ID_POKEGRA1 );
	CATS_FreeResourceChar( wk->crp, CHR_ID_POKEGRA2 );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_POKEGRA1 );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_POKEGRA2 );
	CATS_FreeResourceCell( wk->crp, CEL_ID_POKEGRA );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_POKEGRA );
}

//--------------------------------------------------------------------------------------------
/**
 * ポケモングラフィックリソース読み込み（切り替え用）
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeGra2DummyResLoad( ZKN2_WORK * wk )
{
	CATS_LoadResourceCharArc(
		wk->csp, wk->crp,
		ARC_BATT_OBJ, POKE_OAM_NCGR, 0, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_POKEGRA3 );
	CATS_LoadResourceCharArc(
		wk->csp, wk->crp,
		ARC_BATT_OBJ, POKE_OAM_NCGR, 0, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_POKEGRA4 );

	CATS_LoadResourcePlttWorkArc(
		wk->pfd, FADE_SUB_OBJ,
		wk->csp, wk->crp,
		ARC_BATT_OBJ, POKE_OAM_NCLR,
		0, PALSIZ_POKEGRA1, NNS_G2D_VRAM_TYPE_2DSUB, PAL_ID_POKEGRA3 );

	CATS_LoadResourcePlttWorkArc(
		wk->pfd, FADE_SUB_OBJ,
		wk->csp, wk->crp,
		ARC_BATT_OBJ, POKE_OAM_NCLR,
		0, PALSIZ_POKEGRA1, NNS_G2D_VRAM_TYPE_2DSUB, PAL_ID_POKEGRA4 );
}

//--------------------------------------------------------------------------------------------
/**
 * ポケモングラフィックリソース解放（切り替え用）
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeGra2DummyResFree( ZKN2_WORK * wk )
{
//	CATS_FreeResourceChar( wk->crp, CHR_ID_POKEGRA2 );
	CATS_FreeResourceChar( wk->crp, CHR_ID_POKEGRA3 );
	CATS_FreeResourceChar( wk->crp, CHR_ID_POKEGRA4 );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_POKEGRA3 );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_POKEGRA4 );
//	CATS_FreeResourcePltt( wk->crp, PAL_ID_POKEGRA2 );
}


//--------------------------------------------------------------------------------------------
/**
 * ポケモングラフィックOBJ追加
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeGraObjAdd( ZKN2_WORK * wk, u32 objID )
{
	wk->cap[objID] = CATS_ObjectAdd_S_SubDistance(
						wk->csp, wk->crp,
						&ClaTopPagePrm[ZKN2_OBJ_POKEGRA1],
						ZKN2_SUB_ACTOR_DISTANCE );
	wk->cap[objID+1] = CATS_ObjectAdd_S_SubDistance(
						wk->csp, wk->crp,
						&ClaTopPagePrm[ZKN2_OBJ_POKEGRA2],
						ZKN2_SUB_ACTOR_DISTANCE );
}

//--------------------------------------------------------------------------------------------
/**
 * ポケモングラフィック切り替え
 *
 * @param	wk			図鑑画面ワーク
 * @param	mons		ポケモン番号
 * @param	frm			フォルム番号
 * @param	dir			向き
 * @param	id			OBJ ID
 * @param	pal_mode	パレット転送場所
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeGraChangeCore(
				ZKN2_WORK * wk, u16 mons, u8 frm, u8 sex, u8 dir, u32 id, u32 pal_mode )
{
	SOFT_SPRITE_ARC  ssa;
	void * buf;
	NNSG2dImageProxy * ipc;
	NNSG2dImagePaletteProxy * ipp;
	u32	cgx;
	u32	pal;
	u32	rand;
	CHANGES_INTO_DATA_RECT rect = { POKE_TEX_X, POKE_TEX_Y, POKE_TEX_W, POKE_TEX_H, };

	buf = sys_AllocMemoryLo( HEAPID_ZUKAN, POKEGRA_TEX_SIZE );

	MI_CpuClearFast( &ssa, sizeof(SOFT_SPRITE_ARC) );

	if( mons == MONSNO_PATTIIRU && dir == PARA_FRONT ){
		rand = ZukanWork_GetPokeRandomFlag( wk->dat->zukan_work, ZUKAN_WORK_RANDOM_PACHI );
	}else{
		rand = 0;
	}

	PokeGraArcDataGet(
		&ssa,
		mons,
		sex,
		dir,
		PARA_NORMAL,	// color
		frm,
		rand );

	Ex_ChangesInto_OAM_from_PokeTex_RC(
		ssa.arc_no, ssa.index_chr, HEAPID_ZUKAN,
		&rect, buf, rand, FALSE, dir, mons );

	ipc = CLACT_ImageProxyGet( wk->cap[id]->act );
	cgx = NNS_G2dGetImageLocation( ipc, NNS_G2D_VRAM_TYPE_2DSUB );

	DC_FlushRange( buf, POKEGRA_TEX_SIZE );
	GXS_LoadOBJ( buf, cgx, POKEGRA_TEX_SIZE );

	ipp = CLACT_PaletteProxyGet( wk->cap[id]->act );
	pal = NNS_G2dGetImagePaletteLocation( ipp, NNS_G2D_VRAM_TYPE_2DSUB );

	if( pal_mode == POKEGRA_PAL_VRAM ){
		ArcUtil_PalSet(
			ssa.arc_no, ssa.index_pal, PALTYPE_SUB_OBJ, pal, POKEGRA_PAL_SIZE, HEAPID_ZUKAN );
		PaletteWorkSet_VramCopy( wk->pfd, FADE_SUB_OBJ, pal/2, POKEGRA_PAL_SIZE );
	}else if( pal_mode == POKEGRA_PAL_FADE ){
		PaletteWorkSet_Arc(
			wk->pfd, ssa.arc_no, ssa.index_pal,
			HEAPID_ZUKAN, FADE_SUB_OBJ, POKEGRA_PAL_SIZE, pal/2 );
	}else{
		PaletteWork_Clear( wk->pfd, FADE_SUB_OBJ, FADEBUF_ALL, 0, pal/2, pal/2+16 );
	}

	sys_FreeMemoryEz( buf );
}

//--------------------------------------------------------------------------------------------
/**
 * ポケモングラフィック切り替え
 *
 * @param	wk			図鑑画面ワーク
 * @param	mons		ポケモン番号
 * @param	pokeID		ポケモングラフィックのOBJ ID
 * @param	dmyID		？グラフィックのOBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeGraChange( ZKN2_WORK * wk, u16 mons, u32 pokeID, u32 dmyID )
{
	u32	frm;
	u32	sex;

	CATS_ObjectEnableCap( wk->cap[pokeID+wk->pokegra_swap], ACT_OFF );
	wk->pokegra_swap ^= 1;

	pokeID += wk->pokegra_swap;

	if( mons == 0 ){
		CATS_ObjectEnableCap( wk->cap[dmyID], ACT_ON );
		CATS_ObjectEnableCap( wk->cap[pokeID], ACT_OFF );
		return;
	}

	CATS_ObjectEnableCap( wk->cap[dmyID], ACT_OFF );
	CATS_ObjectEnableCap( wk->cap[pokeID], ACT_ON );

	sex = ZukanWork_GetPokeSexFlag( wk->dat->zukan_work, mons, ZUKAN_WORK_SEX_FIRST );
	frm = ZukanWork_GetPokeForm( wk->dat->zukan_work, mons, 0 );
	if( mons == MONSNO_PITYUU ){
		if( frm == 2 ){
			frm = 1;
			sex = PARA_FEMALE;	// ギザミミピチューは♀にする
		}else{
			frm = 0;
		}
	}

	PokeGraChangeCore( wk, mons, frm, sex, PARA_FRONT, pokeID, POKEGRA_PAL_VRAM );
}

//--------------------------------------------------------------------------------------------
/**
 * ポケモングラフィック切り替え
 *
 * @param	wk			図鑑画面ワーク
 * @param	mons		ポケモン番号
 * @param	pokeID		ポケモングラフィックのOBJ ID
 * @param	dmyID		？グラフィックのOBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_PokeGraChange( ZKN2_WORK * wk, u16 mons, u32 pokeID, u32 dmyID )
{
	PokeGraChange( wk, mons, pokeID, dmyID );
}


//============================================================================================
//	足跡
//============================================================================================

//--------------------------------------------------------------------------------------------
/**
 * 足跡リソース読み込み
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeFootResLoad( ZKN2_WORK * wk )
{
	int	arc = PokeFootArcFileGet();

	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_foot_dmy_lz_NCGR, 1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_POKEFOOT );

	CATS_LoadResourcePlttWorkArc(
		wk->pfd, FADE_SUB_OBJ,
		wk->csp, wk->crp,
		arc, PokeFootPlttDataIdxGet(),
		0, PALSIZ_POKEFOOT, NNS_G2D_VRAM_TYPE_2DSUB, PAL_ID_POKEFOOT );

	CATS_LoadResourceCellArcH(
		wk->csp, wk->crp,
		wk->graphic_ah, NARC_zukan_gra_foot_dmy_lz_NCER, 1, CEL_ID_POKEFOOT );

	CATS_LoadResourceCellAnmArcH(
		wk->csp, wk->crp,
		wk->graphic_ah, NARC_zukan_gra_foot_dmy_lz_NANR, 1, ANM_ID_POKEFOOT );
}

//--------------------------------------------------------------------------------------------
/**
 * 足跡リソース解放
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeFootResFree( ZKN2_WORK * wk )
{
	CATS_FreeResourceChar( wk->crp, CHR_ID_POKEFOOT );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_POKEFOOT );
	CATS_FreeResourceCell( wk->crp, CEL_ID_POKEFOOT );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_POKEFOOT );
}

//--------------------------------------------------------------------------------------------
/**
 * 足跡ＯＢＪ追加
 *
 * @param	wk		図鑑画面ワーク
 * @param	objD	OBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeFootAdd( ZKN2_WORK * wk, u32 objID )
{
	wk->cap[objID] = CATS_ObjectAdd_S_SubDistance(
									wk->csp, wk->crp,
									&ClaListPokeFootPrm,
									ZKN2_SUB_ACTOR_DISTANCE );

	CATS_ObjectPaletteSetCap(
		wk->cap[objID],
		CATS_PlttID_NoGet( wk->crp, PAL_ID_POKEFOOT, NNS_G2D_VRAM_TYPE_2DSUB ) );

	CATS_ObjectEnableCap( wk->cap[objID], ACT_OFF );
}

//--------------------------------------------------------------------------------------------
/**
 * 足跡切り替え
 *
 * @param	wk		図鑑画面ワーク
 * @param	mons	ポケモン番号
 * @param	pos		リスト位置
 * @param	objD	OBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_PokeFootChange( ZKN2_WORK * wk, u16 mons, u32 pos, u32 objID )
{
	NNSG2dCharacterData * chr;
	u8 * cpy;

#if	GS_AFTERMASTER_GF1056_20091006_FIX
	if( wk->lang != PM_LANG || mons == 0 || wk->list_put[pos].type == ZKN2LIST_REGTYPE_SEE ||
			( mons == MONSNO_KIMAIRAN && ZukanWork_GetPokeForm(wk->dat->zukan_work,mons,0) == 1 ) ){
#else
	if( wk->lang != PM_LANG || mons == 0 || wk->list_put[pos].type == ZKN2LIST_REGTYPE_SEE ){
#endif
		CATS_ObjectEnableCap( wk->cap[objID], ACT_OFF );
		return;
	}else{
		CATS_ObjectEnableCap( wk->cap[objID], ACT_ON );
	}

	cpy = ZKN2TOOL_CgxAllocMake( mons, HEAPID_ZUKAN );

	CgxChangeTrans( wk, objID, cpy, ZKN2TOOL_CGX_SIZ, NNS_G2D_VRAM_TYPE_2DSUB );

	sys_FreeMemoryEz( cpy );

//	sys_FreeMemoryEz( buf );
}

//============================================================================================
//	タイプアイコン
//============================================================================================

//--------------------------------------------------------------------------------------------
/**
 * タイプアイコンリソースロード
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void TypeIconResLoad( ZKN2_WORK * wk )
{
	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_type_icon00_lz_NCGR, 1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_TYPEICON1 );
	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_type_icon00_lz_NCGR, 1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_TYPEICON2 );
	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_type_icon00_lz_NCGR, 1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_TYPEICON3 );
	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_type_icon00_lz_NCGR, 1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_TYPEICON4 );

	CATS_LoadResourcePlttWorkArcH(
		wk->pfd, FADE_SUB_OBJ,
		wk->csp, wk->crp,
		wk->graphic_ah, NARC_zukan_gra_type_icon_NCLR,
		0, PALSIZ_TYPEICON, NNS_G2D_VRAM_TYPE_2DSUB, PAL_ID_TYPEICON );

	CATS_LoadResourceCellArcH(
		wk->csp, wk->crp,
		wk->graphic_ah, NARC_zukan_gra_type_icon_lz_NCER, 1, CEL_ID_TYPEICON );

	CATS_LoadResourceCellAnmArcH(
		wk->csp, wk->crp,
		wk->graphic_ah, NARC_zukan_gra_type_icon_lz_NANR, 1, ANM_ID_TYPEICON );
}

//--------------------------------------------------------------------------------------------
/**
 * タイプアイコンリソース解放
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void TypeIconResFree( ZKN2_WORK * wk )
{
	CATS_FreeResourceChar( wk->crp, CHR_ID_TYPEICON1 );
	CATS_FreeResourceChar( wk->crp, CHR_ID_TYPEICON2 );
	CATS_FreeResourceChar( wk->crp, CHR_ID_TYPEICON3 );
	CATS_FreeResourceChar( wk->crp, CHR_ID_TYPEICON4 );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_TYPEICON );
	CATS_FreeResourceCell( wk->crp, CEL_ID_TYPEICON );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_TYPEICON );
}


//--------------------------------------------------------------------------------------------
/**
 * タイプアイコンＯＢＪ追加
 *
 * @param	wk		図鑑画面ワーク
 * @param	objD	OBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void TypeIconAdd( ZKN2_WORK * wk, u32 objID )
{
	TCATS_OBJECT_ADD_PARAM_S	prm;

	prm = ClaListTypeIconPrm;
	wk->cap[objID] = CATS_ObjectAdd_S_SubDistance(
						wk->csp, wk->crp, &prm, ZKN2_SUB_ACTOR_DISTANCE );
	prm.id[0] = CHR_ID_TYPEICON3;
	wk->cap[objID+2] = CATS_ObjectAdd_S_SubDistance(
						wk->csp, wk->crp, &prm, ZKN2_SUB_ACTOR_DISTANCE );
	prm.x += TYPEICON_X_SPACE;
	prm.id[0] = CHR_ID_TYPEICON2;
	wk->cap[objID+1] = CATS_ObjectAdd_S_SubDistance(
						wk->csp, wk->crp, &prm, ZKN2_SUB_ACTOR_DISTANCE );
	prm.id[0] = CHR_ID_TYPEICON4;
	wk->cap[objID+3] = CATS_ObjectAdd_S_SubDistance(
						wk->csp, wk->crp, &prm, ZKN2_SUB_ACTOR_DISTANCE );
}

//--------------------------------------------------------------------------------------------
/**
 * タイプアイコン表示切替
 *
 * @param	wk		図鑑画面ワーク
 * @param	mons	ポケモン番号
 * @param	pos		配置位置
 * @param	objD	OBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_TypeIconAnmChg( ZKN2_WORK * wk, u16 mons, u32 pos, u32 objID )
{
	u32	frm;
	u16	type1, type2;

	if( wk->lang != PM_LANG || mons == 0 || wk->list_put[pos].type == ZKN2LIST_REGTYPE_SEE ){
		CATS_ObjectEnableCap( wk->cap[objID], ACT_OFF );
		CATS_ObjectEnableCap( wk->cap[objID+1], ACT_OFF );
		CATS_ObjectEnableCap( wk->cap[objID+2], ACT_OFF );
		CATS_ObjectEnableCap( wk->cap[objID+3], ACT_OFF );
		return;
	}

	if( wk->type_swap == 0 ){
		CATS_ObjectEnableCap( wk->cap[objID], ACT_OFF );
		CATS_ObjectEnableCap( wk->cap[objID+1], ACT_OFF );
		objID += 2;
	}else{
		CATS_ObjectEnableCap( wk->cap[objID+2], ACT_OFF );
		CATS_ObjectEnableCap( wk->cap[objID+3], ACT_OFF );
	}
	wk->type_swap ^= 1;

	frm = ZukanWork_GetPokeForm( wk->dat->zukan_work, mons, 0 );
	if( mons == MONSNO_PITYUU ){
		if( frm == 2 ){
			frm = 1;
		}else{
			frm = 0;
		}
	}

	type1 = PokeFormNoPersonalParaGet( mons, frm, ID_PER_type1 );
	TypeIconCgxChange( wk, objID, type1 );
	CATS_ObjectEnableCap( wk->cap[objID], ACT_ON );

	type2 = PokeFormNoPersonalParaGet( mons, frm, ID_PER_type2 );
	if( type2 == 0 || type1 == type2 ){
		CATS_ObjectEnableCap( wk->cap[objID+1], ACT_OFF );
	}else{
		TypeIconCgxChange( wk, objID+1, type2 );
		CATS_ObjectEnableCap( wk->cap[objID+1], ACT_ON );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * タイプアイコンキャラ変更
 *
 * @param	wk		図鑑画面ワーク
 * @param	objD	OBJ ID
 * @param	type	タイプ
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void TypeIconCgxChange( ZKN2_WORK * wk, u32 objID, u32 type )
{
	NNSG2dCharacterData * chr;
	void * buf;

	buf = ArcUtil_HDL_CharDataGet(
			wk->graphic_ah,
			ZKN2TOOL_TypeIconCharArcIDGet(type), TRUE, &chr, HEAPID_ZUKAN );

	CgxChangeTrans( wk, objID, chr->pRawData, ZKN2_TYPEICON_CGX_SIZE, NNS_G2D_VRAM_TYPE_2DSUB );
	CATS_ObjectPaletteSetCap(
		wk->cap[objID],
		CATS_PlttID_NoGet(wk->crp,PAL_ID_TYPEICON,NNS_G2D_VRAM_TYPE_2DSUB)+ZKN2TOOL_TypeIconPalNumGet(type) );

	sys_FreeMemoryEz( buf );
}



//============================================================================================
//	言語アイコン
//============================================================================================

//--------------------------------------------------------------------------------------------
/**
 * 言語アイコンリソースロード（メイン画面用）
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void LangIconResLoadMain( ZKN2_WORK * wk )
{
	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_gengo_lz_NCGR, 1, NNS_G2D_VRAM_TYPE_2DMAIN, CHR_ID_LANGICON_M );

	CATS_LoadResourcePlttWorkArcH(
		wk->pfd, FADE_MAIN_OBJ,
		wk->csp, wk->crp, wk->graphic_ah, NARC_zukan_gra_zukan_gs_obj_gengo_NCLR,
		0, PALSIZ_LANGICON, NNS_G2D_VRAM_TYPE_2DMAIN, PAL_ID_LANGICON_M );

	CATS_LoadResourceCellArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_gengo_lz_NCER, 1, CEL_ID_LANGICON_M );

	CATS_LoadResourceCellAnmArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_gengo_lz_NANR, 1, ANM_ID_LANGICON_M );
}

//--------------------------------------------------------------------------------------------
/**
 * 言語アイコンリソース解放（メイン画面用）
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void LangIconResFreeMain( ZKN2_WORK * wk )
{
	CATS_FreeResourceChar( wk->crp, CHR_ID_LANGICON_M );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_LANGICON_M );
	CATS_FreeResourceCell( wk->crp, CEL_ID_LANGICON_M );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_LANGICON_M );
}

//--------------------------------------------------------------------------------------------
/**
 * 言語アイコンリソースロード（サブ画面用）
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void LangIconResLoadSub( ZKN2_WORK * wk )
{
	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_gengo_lz_NCGR, 1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_LANGICON_S );

	CATS_LoadResourcePlttWorkArcH(
		wk->pfd, FADE_SUB_OBJ,
		wk->csp, wk->crp, wk->graphic_ah, NARC_zukan_gra_zukan_gs_obj_gengo_NCLR,
		0, PALSIZ_LANGICON, NNS_G2D_VRAM_TYPE_2DSUB, PAL_ID_LANGICON_S );

	CATS_LoadResourceCellArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_gengo_lz_NCER, 1, CEL_ID_LANGICON_S );

	CATS_LoadResourceCellAnmArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_gengo_lz_NANR, 1, ANM_ID_LANGICON_S );
}

//--------------------------------------------------------------------------------------------
/**
 * 言語アイコンリソース解放（サブ画面用）
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void LangIconResFreeSub( ZKN2_WORK * wk )
{
	CATS_FreeResourceChar( wk->crp, CHR_ID_LANGICON_S );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_LANGICON_S );
	CATS_FreeResourceCell( wk->crp, CEL_ID_LANGICON_S );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_LANGICON_S );
}

//--------------------------------------------------------------------------------------------
/**
 * 言語アイコンＯＢＪ追加
 *
 * @param	wk		図鑑画面ワーク
 * @param	id		OBJ ID
 * @param	prm		ＯＢＪデータ
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void LangIconAdd( ZKN2_WORK * wk, u32 id, const TCATS_OBJECT_ADD_PARAM_S * prm )
{
	if( prm->vram_trans == NNS_G2D_VRAM_TYPE_2DMAIN ){
		wk->cap[id] = CATS_ObjectAdd_S( wk->csp, wk->crp, prm );
	}else{
		wk->cap[id] = CATS_ObjectAdd_S_SubDistance(
						wk->csp, wk->crp, prm, ZKN2_SUB_ACTOR_DISTANCE );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 言語アイコンＯＢＪ追加（全体）
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void ListLangIconAdd( ZKN2_WORK * wk )
{
	TCATS_OBJECT_ADD_PARAM_S prm;
	u32	i;

	prm = ClaListLangIconSPrm;

	for( i=ZKN2_OBJ_LANGICON1; i<=ZKN2_OBJ_LANGICON6; i++ ){
//		prm.anm = ( i - ZKN2_OBJ_LANGICON1 );
		prm.x = LISTSUB_LANGICON_PX + LISTSUB_LANGICON_SX * (i-ZKN2_OBJ_LANGICON1);
		LangIconAdd( wk, i, &prm );
		CATS_ObjectPaletteSetCap(
			wk->cap[i],
			CATS_PlttID_NoGet( wk->crp, PAL_ID_LANGICON_S, NNS_G2D_VRAM_TYPE_2DSUB ) );
	}
	LangIconAdd( wk, ZKN2_OBJ_LANGICON_M, &ClaTopPagePrm[ZKN2_OBJ_LANGICON_M] );
//	CATS_ObjectEnableCap( wk->cap[ZKN2_OBJ_LANGICON_M], ACT_OFF );
}

//--------------------------------------------------------------------------------------------
/**
 * 言語アイコン表示切替（下画面）
 *
 * @param	wk		図鑑画面ワーク
 * @param	mons	ポケモン番号
 * @param	id		OBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_ListMainLangIconChg( ZKN2_WORK * wk, u16 mons, u32 objID )
{
	u32	lang;
	u32	i;

	if( mons == 0 || ZukanWork_GetTextVersionUpMasterFlag(wk->dat->zukan_work) == FALSE ){
		CATS_ObjectEnableCap( wk->cap[objID], ACT_OFF );
	}else{
		lang = ZKN_WT_GetLANG_Code_ZKN_WORLD_TEXT_Code( wk->lang );
		ZKN2OBJ_AnmSet( wk, objID, lang );
		CATS_ObjectEnableCap( wk->cap[objID], ACT_ON );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 言語アイコン表示切替（上画面）
 *
 * @param	wk		図鑑画面ワーク
 * @param	mons	ポケモン番号
 * @param	id		OBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_ListSubLangIconChg( ZKN2_WORK * wk, u16 mons, u32 objID )
{
	u32	lang;
	u32	type;
	s16	i, j;
	s16	x, y;

	if( mons == 0 || ZukanWork_GetTextVersionUpMasterFlag(wk->dat->zukan_work) == FALSE ){
		for( i=objID; i<=objID+5; i++ ){
			CATS_ObjectEnableCap( wk->cap[i], ACT_OFF );
		}
	}else{
		j=0;
		for( i=objID+5; i>=objID; i-- ){
			lang = ZKN_WT_GetZKN_WORLD_TEXT_Code_LANG_Code( i-objID );
			if( ZKN2MAIN_LangCheck( wk, mons, lang ) == TRUE || lang == PM_LANG ){
				lang = ZKN_WT_GetLANG_Code_ZKN_WORLD_TEXT_Code( wk->lang );
				type = i - objID;
				if( type == lang ){
					ZKN2OBJ_AnmSet( wk, i, type );
				}else{
					ZKN2OBJ_AnmSet( wk, i, type + ZKN_WORLD_TEXT_NUM );
				}
				CATS_ObjectPosGetCap( wk->cap[i], &x, &y );
				CATS_ObjectPosSetCap(
					wk->cap[i],
					LISTSUB_LANGICON_PX+(objID+5-objID-j)*LISTSUB_LANGICON_SX,
					y );
				CATS_ObjectEnableCap( wk->cap[i], ACT_ON );
				j++;
			}else{
				CATS_ObjectEnableCap( wk->cap[i], ACT_OFF );
			}
		}
	}
}


//============================================================================================
//	その他のＯＢＪ
//============================================================================================

//--------------------------------------------------------------------------------------------
/**
 * その他のＯＢＪのリソース読み込み（メイン画面）
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void ZukanObjResLoadMain( ZKN2_WORK * wk )
{
	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_m_lz_NCGR,
		1, NNS_G2D_VRAM_TYPE_2DMAIN, CHR_ID_ZKNOBJ_M );

	CATS_LoadResourcePlttWorkArcH(
		wk->pfd, FADE_MAIN_OBJ,
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_m_NCLR, 0,
		PALSIZ_ZKNOBJ_M, NNS_G2D_VRAM_TYPE_2DMAIN, PAL_ID_ZKNOBJ_M );

	CATS_LoadResourceCellArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_m_lz_NCER, 1, CEL_ID_ZKNOBJ_M );
	CATS_LoadResourceCellAnmArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_m_lz_NANR, 1, ANM_ID_ZKNOBJ_M );
}

//--------------------------------------------------------------------------------------------
/**
 * その他のＯＢＪのリソース解放（メイン画面）
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void ZukanObjResFreeMain( ZKN2_WORK * wk )
{
	CATS_FreeResourceChar( wk->crp, CHR_ID_ZKNOBJ_M );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_ZKNOBJ_M );
	CATS_FreeResourceCell( wk->crp, CEL_ID_ZKNOBJ_M );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_ZKNOBJ_M );
}

//--------------------------------------------------------------------------------------------
/**
 * その他のＯＢＪのリソース読み込み（サブ画面）
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void ZukanObjResLoadSub( ZKN2_WORK * wk )
{
	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_list_s_lz_NCGR,
		1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_ZKNOBJ_S );

	CATS_LoadResourcePlttWorkArcH(
		wk->pfd, FADE_SUB_OBJ,
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_s_NCLR, 0,
		PALSIZ_ZKNOBJ_S, NNS_G2D_VRAM_TYPE_2DSUB, PAL_ID_ZKNOBJ_S );

	CATS_LoadResourceCellArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_list_s_lz_NCER, 1, CEL_ID_ZKNOBJ_S );
	CATS_LoadResourceCellAnmArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_list_s_lz_NANR, 1, ANM_ID_ZKNOBJ_S );

	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_ball_s_lz_NCGR,
		1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_BALL_S );

	CATS_LoadResourceCellArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_ball_s_lz_NCER, 1, CEL_ID_BALL_S );
	CATS_LoadResourceCellAnmArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_ball_s_lz_NANR, 1, ANM_ID_BALL_S );
}

//--------------------------------------------------------------------------------------------
/**
 * その他のＯＢＪのリソース解放（サブ画面）
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void ZukanObjResFreeSub( ZKN2_WORK * wk )
{
	CATS_FreeResourceChar( wk->crp, CHR_ID_ZKNOBJ_S );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_ZKNOBJ_S );
	CATS_FreeResourceCell( wk->crp, CEL_ID_ZKNOBJ_S );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_ZKNOBJ_S );

	CATS_FreeResourceChar( wk->crp, CHR_ID_BALL_S );
	CATS_FreeResourceCell( wk->crp, CEL_ID_BALL_S );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_BALL_S );
}

//--------------------------------------------------------------------------------------------
/**
 * リストページのＯＢＪ追加
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_ListPageInit( ZKN2_WORK * wk )
{
	u32	pos;
	u16	mons;

	ListPageResLoad( wk );

	PokeIconObjAdd( wk, ZKN2_OBJ_POKEICON );
	ZKN2OBJ_PokeIconListInit( wk, ZKN2_OBJ_POKEICON );

	ListPageObjAdd( wk );

	if( wk->zenkoku_mode == FALSE ){
		CATS_ObjectEnableCap( wk->cap[ZKN2_OBJ_SWITCH], ACT_OFF );
	}else{
		ZKN2OBJ_CoverSwithPut( wk, ZKN2_OBJ_SWITCH );
	}

	ZKN2OBJ_ListCursorMove( wk, ZKN2_OBJ_CURSOR );

	ZKN2OBJ_ListArrowAnmChange( wk, ZKN2_OBJ_ARROW_U, TRUE );

	ZKN2OBJ_ListBarAnmChg( wk, ZKN2_OBJ_BAR, TRUE );
	ZKN2OBJ_ListBarPosYSet( wk, ZKN2_OBJ_BAR, TRUE );

	mons = ZKN2LIST_SelMonsGet( wk );
	pos  = ZKN2LIST_SelPosGet( wk );

	PokeGraObjAdd( wk, ZKN2_OBJ_POKEGRA1 );
	ZKN2OBJ_PokeGraChange( wk, mons, ZKN2_OBJ_POKEGRA1, ZKN2_OBJ_NAZOPOKE_S );

	TypeIconAdd( wk, ZKN2_OBJ_TYPEICON1 );
	ZKN2OBJ_TypeIconAnmChg( wk, mons, pos, ZKN2_OBJ_TYPEICON1 );

	PokeFootAdd( wk, ZKN2_OBJ_POKEFOOT );
	ZKN2OBJ_PokeFootChange( wk, mons, pos, ZKN2_OBJ_POKEFOOT );

	ZKN2OBJ_ListBallPut( wk, pos, ZKN2_OBJ_BALL_S );

	ListLangIconAdd( wk );
	ZKN2OBJ_ListSubLangIconChg( wk, mons, ZKN2_OBJ_LANGICON1 );
	ZKN2OBJ_ListMainLangIconChg( wk, mons, ZKN2_OBJ_LANGICON_M );
	CATS_ObjectEnableCap( wk->cap[ZKN2_OBJ_LANGICON_M], ACT_OFF );
}

//--------------------------------------------------------------------------------------------
/**
 * リストページのリソース読み込み
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void ListPageResLoad( ZKN2_WORK * wk )
{
	// メイン
	PokeIconResLoad( wk, ZKN2_POKEICON_ADD_MAX*2 );
	ZukanObjResLoadMain( wk );
	LangIconResLoadMain( wk );

	// サブ
	PokeGraDummyResLoad( wk );
	PokeFootResLoad( wk );
	TypeIconResLoad( wk );
	ZukanObjResLoadSub( wk );
	LangIconResLoadSub( wk );
}

//--------------------------------------------------------------------------------------------
/**
 * リストページのＯＢＪ追加
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void ListPageObjAdd( ZKN2_WORK * wk )
{
	u32	i;

	for( i=ZKN2_OBJ_SWITCH; i<=ZKN2_OBJ_ARROW_R; i++ ){
		wk->cap[i] = CATS_ObjectAdd_S( wk->csp, wk->crp, &ClaTopPagePrm[i-ZKN2_OBJ_SWITCH] );
	}
	CATS_ObjectEnableCap( wk->cap[ZKN2_OBJ_ARROW_L], ACT_OFF );
	CATS_ObjectEnableCap( wk->cap[ZKN2_OBJ_ARROW_R], ACT_OFF );

	wk->cap[ZKN2_OBJ_BALL_S] = CATS_ObjectAdd_S_SubDistance(
									wk->csp, wk->crp,
									&ClaTopPagePrm[ZKN2_OBJ_BALL_S], ZKN2_SUB_ACTOR_DISTANCE );
	wk->cap[ZKN2_OBJ_NAZOPOKE_S] = CATS_ObjectAdd_S_SubDistance(
										wk->csp, wk->crp,
										&ClaTopPagePrm[ZKN2_OBJ_NAZOPOKE_S], ZKN2_SUB_ACTOR_DISTANCE );
}

//--------------------------------------------------------------------------------------------
/**
 * リストページの言語切り替え矢印表示切替
 *
 * @param	wk		図鑑画面ワーク
 * @param	flg		TRUE = ON, FALSE = OFF
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_LangArrowVanish( ZKN2_WORK * wk, u32 objID, BOOL flg )
{
	if( flg == TRUE &&
		ZukanWork_GetTextVersionUpMasterFlag(wk->dat->zukan_work) == TRUE ){
		CATS_ObjectEnableCap( wk->cap[objID], ACT_ON );
		CATS_ObjectEnableCap( wk->cap[objID+1], ACT_ON );
	}else{
		CATS_ObjectEnableCap( wk->cap[objID], ACT_OFF );
		CATS_ObjectEnableCap( wk->cap[objID+1], ACT_OFF );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * リストページの下画面言語アイコン表示切替
 *
 * @param	wk		図鑑画面ワーク
 * @param	flg		TRUE = ON, FALSE = OFF
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_ListLangVanish( ZKN2_WORK * wk, u32 objID, BOOL flg )
{
	if( flg == TRUE &&
		ZukanWork_GetTextVersionUpMasterFlag(wk->dat->zukan_work) == TRUE ){
		CATS_ObjectEnableCap( wk->cap[objID], ACT_ON );
	}else{
		CATS_ObjectEnableCap( wk->cap[objID], ACT_OFF );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 図鑑モード切替スイッチ移動
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_CoverSwithPut( ZKN2_WORK * wk, u32 objID )
{
	if( wk->zkn_mode == ZKN2_MODE_JOHTO ){
		CATS_ObjectPosSetCap( wk->cap[objID], TOP_SWITCH_JOHTO_X, TOP_SWITCH_Y );
	}else{
		CATS_ObjectPosSetCap( wk->cap[objID], TOP_SWITCH_ZENKOKU_X, TOP_SWITCH_Y );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 指定座標に図鑑モード切替スイッチがあるか
 *
 * @param	wk		図鑑画面ワーク
 * @param	x		Ｘ座標
 * @param	y		Ｙ座標
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
BOOL ZKN2OBJ_CoverSwitchCheck( ZKN2_WORK * wk, u32 x, u32 y )
{
	s16	obj_x, obj_y;

	CATS_ObjectPosGetCap( wk->cap[ZKN2_OBJ_SWITCH], &obj_x, &obj_y );

	if( x >= ( obj_x - COVER_SWITCH_SX_HALF ) && x < ( obj_x + COVER_SWITCH_SX_HALF ) &&
		y >= ( obj_y - COVER_SWITCH_SY_HALF ) && y < ( obj_y + COVER_SWITCH_SY_HALF ) ){
		return TRUE;
	}
	return FALSE;
}

//--------------------------------------------------------------------------------------------
/**
 * 図鑑モード切り替えスイッチＯＢＪをスクロール
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 * @param	spd		移動速度
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_CoverObjScroll( ZKN2_WORK * wk, u16 objID, s16 spd )
{
	s16	x, y;

	// スイッチ
	CATS_ObjectPosGetCap( wk->cap[objID], &x, &y );
	CATS_ObjectPosSetCap( wk->cap[objID], x+spd, y );
}

//--------------------------------------------------------------------------------------------
/**
 * 図鑑モード切り替えスイッチＯＢＪを移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 * @param	px		Ｘ座標
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_CoverObjMove( ZKN2_WORK * wk, u16 objID, s16 px )
{
	s16	x, y;

	// スイッチ
	CATS_ObjectPosGetCap( wk->cap[objID], &x, &y );
	CATS_ObjectPosSetCap( wk->cap[objID], px, y );
}

//--------------------------------------------------------------------------------------------
/**
 * 図鑑モード切り替えスイッチＯＢＪのモードごとの座標取得
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	現在のモードのＸ座標
 */
//--------------------------------------------------------------------------------------------
s16 ZKN2OBJ_CoverDefObjPxGet( ZKN2_WORK * wk )
{
	s16	x;

	if( wk->zkn_mode == ZKN2_MODE_JOHTO ){
		x = TOP_SWITCH_JOHTO_X;
	}else{
		x = TOP_SWITCH_ZENKOKU_X;
	}
	return x;
}

//--------------------------------------------------------------------------------------------
/**
 * リストカーソル移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_ListCursorMove( ZKN2_WORK * wk, u32 objID )
{
	s16	x, y;

	x = LIST_CURSOR_PX + ( wk->list_pos % ZKN2_POKEICON_PUT_H_MAX ) * LIST_CURSOR_SX;
	y = LIST_CURSOR_PY + ( wk->list_pos / ZKN2_POKEICON_PUT_H_MAX ) * LIST_CURSOR_SY;

	CATS_ObjectPosSetCap( wk->cap[objID], x, y );
	CATS_ObjectEnableCap( wk->cap[objID], ACT_ON );
}

//--------------------------------------------------------------------------------------------
/**
 * リストカーソル非表示
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_ListCursorOff( ZKN2_WORK * wk )
{
	CATS_ObjectEnableCap( wk->cap[ZKN2_OBJ_CURSOR], ACT_OFF );
}

//--------------------------------------------------------------------------------------------
/**
 * リストスクロール矢印アニメ切り替え
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJID
 * @param	space	リストにスペースがあるか ( TRUE = あり )
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_ListArrowAnmChange( ZKN2_WORK * wk, u32 objID, BOOL space )
{
	if( wk->list_scr == 0 ){
		ZKN2OBJ_AnmSet( wk, objID, ZKN2OBJ_M_ANM_UP_OFF );
	}else{
		ZKN2OBJ_AnmSet( wk, objID, ZKN2OBJ_M_ANM_UP_ON );
	}
	if( wk->list_scr == ZKN2LIST_ListScrollMaxGet(wk,space) ){
		ZKN2OBJ_AnmSet( wk, objID+1, ZKN2OBJ_M_ANM_DOWN_OFF );
	}else{
		ZKN2OBJ_AnmSet( wk, objID+1, ZKN2OBJ_M_ANM_DOWN_ON );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * リスト切り替えバーのアニメ変更
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJID
 * @param	space	リストにスペースがあるか ( TRUE = あり )
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_ListBarAnmChg( ZKN2_WORK * wk, u32 objID, BOOL space )
{
	ZKN2OBJ_AnmSet( wk, objID, ListBarAnmGet(wk,space) );
}

//--------------------------------------------------------------------------------------------
/**
 * リスト切り替えバーのアニメ番号取得
 *
 * @param	wk		図鑑画面ワーク
 * @param	space	リストにスペースがあるか ( TRUE = あり )
 *
 * @return	アニメ番号
 */
//--------------------------------------------------------------------------------------------
static u32 ListBarAnmGet( ZKN2_WORK * wk, BOOL space )
{
	u32	max;
	u32	i;

	max = ZKN2LIST_ListMaxGet( wk, space );

	for( i=0; i<NELEMS(ListBarAnmMaxTbl); i++ ){
		if( max <= ListBarAnmMaxTbl[i] ){
			break;
		}
	}
	return ( ZKN2OBJ_M_ANM_BAR1 + i );
}

//--------------------------------------------------------------------------------------------
/**
 * リスト切り替えバーのＹサイズ取得
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 *
 * @return	Ｙサイズ
 */
//--------------------------------------------------------------------------------------------
static u8 ListBarYSizeGet( ZKN2_WORK * wk, u32 objID )
{
	return ListBarDotYSiz[CATS_ObjectAnimeSeqGetCap(wk->cap[objID])-ZKN2OBJ_M_ANM_BAR1];
}

//--------------------------------------------------------------------------------------------
/**
 * リスト切り替えバーのＹ座標移動最小値
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 *
 * @return	Ｙ座標移動最小値
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2OBJ_ListBarMoveYMin( ZKN2_WORK * wk, u32 objID )
{
	u32	siz = ListBarYSizeGet( wk, objID );
	return ( LIST_RAIL_PY - LIST_RAIL_SY / 2 + siz / 2 );
}

//--------------------------------------------------------------------------------------------
/**
 * リスト切り替えバーのＹ座標移動最大値
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 *
 * @return	Ｙ座標移動最小値
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2OBJ_ListBarMoveYMax( ZKN2_WORK * wk, u32 objID )
{
	u32	siz = ListBarYSizeGet( wk, objID );
	return ( LIST_RAIL_PY + LIST_RAIL_SY / 2 - siz / 2 );
}

//--------------------------------------------------------------------------------------------
/**
 * 指定座標にリスト切り替えバーがあるか
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 * @param	tpx		Ｘ座標
 * @param	tpy		Ｙ座標
 *
 * @retval	"TRUE = あり"
 * @retval	"FALSE = なし"
 */
//--------------------------------------------------------------------------------------------
BOOL ZKN2OBJ_ListBarCheck( ZKN2_WORK * wk, u32 objID, u32 tpx, u32 tpy )
{
	s16	obj_x, obj_y;
	u32	sy;

	CATS_ObjectPosGetCap( wk->cap[objID], &obj_x, &obj_y );

	sy = ListBarYSizeGet( wk, objID );

	if( tpx >= ( obj_x - LIST_BAR_SX / 2 ) && tpx <= ( obj_x + LIST_BAR_SX / 2 ) &&
		tpy >= ( obj_y - sy / 2 ) && tpy <= ( obj_y + sy / 2 ) ){
		return TRUE;
	}

	return FALSE;
}

//--------------------------------------------------------------------------------------------
/**
 * 指定座標にリスト切り替えバーを移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 * @param	tpx		Ｘ座標
 * @param	tpy		Ｙ座標
 * @param	space	リストにスペースがあるか ( TRUE = あり )
 *
 * @retval	"TRUE = スクロール"
 * @retval	"FALSE = それ以外"
 */
//--------------------------------------------------------------------------------------------
BOOL ZKN2OBJ_ListBarMove( ZKN2_WORK * wk, u32 objID, u32 tpx, u32 tpy, BOOL space )
{
	u32	prm;
	s16	obj_x, obj_y;

	CATS_ObjectPosGetCap( wk->cap[objID], &obj_x, &obj_y );

	prm = ZKN2OBJ_ListBarMoveYMin( wk, objID );
	if( tpy < prm ){
		tpy = prm;
	}
	prm = ZKN2OBJ_ListBarMoveYMax( wk, objID );
	if( tpy > prm ){
		tpy = prm;
	}

	CATS_ObjectPosSetCap( wk->cap[objID], obj_x, tpy );

	{
		u32	scr_max;
		u32	scr_siz;
		u32	scr_pos;
		u32	min;
		u32	dot;
		u32	i;

		min = ZKN2OBJ_ListBarMoveYMin( wk, objID );
		dot = ZKN2OBJ_ListBarMoveYMax( wk, objID ) - min;

		scr_max = ZKN2LIST_ListScrollMaxGet( wk, space );
		scr_siz = ( ( dot << 8 ) / scr_max );
		scr_pos = (tpy - min ) << 8;

		for( i=0; i<=scr_max; i++ ){
			if( scr_pos >= ( scr_siz * i ) && scr_pos < ( scr_siz * (i+1) ) ){
				if( wk->list_scr != i ){
					wk->list_scr = i;
					return TRUE;
				}
				break;
			}
		}
	}

	return FALSE;
}

//--------------------------------------------------------------------------------------------
/**
 * スクロール値からリスト切り替えバーのＹ座標を取得
 *
 * @param	wk		図鑑画面ワーク
 * @param	scr		スクロール値
 * @param	objID	OBJ ID
 * @param	space	リストにスペースがあるか ( TRUE = あり )
 *
 * @return	Ｙ座標
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2OBJ_ListBarPosYGet( ZKN2_WORK * wk, u32 scr, u32 objID, BOOL space )
{
	u32	min, max, siz;
	u32	scr_max;

	min = ZKN2OBJ_ListBarMoveYMin( wk, objID );
	max = ZKN2OBJ_ListBarMoveYMax( wk, objID );

	scr_max = ZKN2LIST_ListScrollMaxGet( wk, space );

	if( scr == scr_max ){
		return max;
	}

	siz = ( ( max - min ) << 8 ) / scr_max;

	return ( min + ( ( siz * scr ) >> 8 ) );
}

//--------------------------------------------------------------------------------------------
/**
 * リスト切り替えバーの１フレームのＹ移動量を取得
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 * @param	py		Ｙ座標
 * @param	cnt		動作フレーム数
 *
 * @return	Ｙ移動量
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2OBJ_ListBarAotoMoveCntGet( ZKN2_WORK * wk, u32 objID, u32 py, u32 cnt )
{
	s16	obj_x, obj_y;

	CATS_ObjectPosGetCap( wk->cap[objID], &obj_x, &obj_y );
	if( py >= obj_y ){
		return ( ( py - obj_y ) / cnt );
	}
	return ( ( obj_y - py ) / cnt );
}

//--------------------------------------------------------------------------------------------
/**
 * リスト切り替えバーを移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 * @param	my		Ｙ移動量
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_ListBarAotoMove( ZKN2_WORK * wk, u32 objID, s32 my )
{
	s16	obj_x, obj_y;

	CATS_ObjectPosGetCap( wk->cap[objID], &obj_x, &obj_y );
	CATS_ObjectPosSetCap( wk->cap[objID], obj_x, obj_y+my );
}

//--------------------------------------------------------------------------------------------
/**
 * リスト切り替えバーを現在のスクロール位置へ移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 * @param	space	リストにスペースがあるか ( TRUE = あり )
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_ListBarPosYSet( ZKN2_WORK * wk, u32 objID, BOOL space )
{
	s16	obj_x, obj_y;

	CATS_ObjectPosGetCap( wk->cap[objID], &obj_x, &obj_y );
	CATS_ObjectPosSetCap(
		wk->cap[objID],
		obj_x, ZKN2OBJ_ListBarPosYGet(wk,wk->list_scr,objID,space) );
}

//--------------------------------------------------------------------------------------------
/**
 * 捕獲済みボール表示切り替え
 *
 * @param	wk		図鑑画面ワーク
 * @param	pos		選択位置
 * @param	objID	OBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_ListBallPut( ZKN2_WORK * wk, u32 pos, u32 objID )
{
	if( wk->list_put[pos].type == ZKN2LIST_REGTYPE_GET ){
		CATS_ObjectEnableCap( wk->cap[objID], ACT_ON );
	}else{
		CATS_ObjectEnableCap( wk->cap[objID], ACT_OFF );
	}
}


//--------------------------------------------------------------------------------------------
/**
 * トップ・リスト画面ＯＢＪ全削除
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_TopListObjDelete( ZKN2_WORK * wk )
{
	int	i;

	ClactDelAll( wk );

	// メイン
	PokeIconResFree( wk, ZKN2_POKEICON_ADD_MAX*2 );
	ZukanObjResFreeMain( wk );
	LangIconResFreeMain( wk );

	// サブ
	PokeGraDummyResFree( wk );
	PokeFootResFree( wk );
	TypeIconResFree( wk );
	ZukanObjResFreeSub( wk );
	LangIconResFreeSub( wk );
}


//--------------------------------------------------------------------------------------------
/**
 * 検索画面ＯＢＪ初期化
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchPageInit( ZKN2_WORK * wk )
{
	SearchPageMainResLoad( wk );
	SearchPageMainObjAdd( wk );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面リソース読み込み
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchPageMainResLoad( ZKN2_WORK * wk )
{
	// メイン
	PokeIconResLoad( wk, ZKN2_POKEICON_ADD_MAX*2 );
	ZukanObjResLoadMain( wk );
	LangIconResLoadMain( wk );

	// 形検索アイコン
	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zkn_form_lz_NCGR,
		1, NNS_G2D_VRAM_TYPE_2DMAIN, CHR_ID_SEARCH_FORM );

	CATS_LoadResourcePlttWorkArcH(
		wk->pfd, FADE_MAIN_OBJ,
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zkn_form_NCLR, 0,
		PALSIZ_SEARCH_FORM_M, NNS_G2D_VRAM_TYPE_2DMAIN, PAL_ID_SEARCH_FORM );

	CATS_LoadResourceCellArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zkn_form_lz_NCER, 1, CEL_ID_SEARCH_FORM );
	CATS_LoadResourceCellAnmArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zkn_form_lz_NANR, 1, ANM_ID_SEARCH_FORM );

	// 形検索アイコン（サブ）
	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zkn_form_lz_NCGR,
		1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_SEARCH_FORM_S );

	CATS_LoadResourcePlttWorkArcH(
		wk->pfd, FADE_SUB_OBJ,
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zkn_form_NCLR, 0,
		PALSIZ_SEARCH_FORM_M, NNS_G2D_VRAM_TYPE_2DSUB, PAL_ID_SEARCH_FORM_S );

	CATS_LoadResourceCellArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zkn_form_lz_NCER, 1, CEL_ID_SEARCH_FORM_S );
	CATS_LoadResourceCellAnmArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zkn_form_lz_NANR, 1, ANM_ID_SEARCH_FORM_S );

	// ヤドン・ゲージ
	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_s_lz_NCGR,
		1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_SEARCH_S );

	CATS_LoadResourcePlttWorkArcH(
		wk->pfd, FADE_SUB_OBJ,
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_s_NCLR, 0,
		PALSIZ_SEARCH_S, NNS_G2D_VRAM_TYPE_2DSUB, PAL_ID_SEARCH_S );

	CATS_LoadResourceCellArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_s_lz_NCER, 1, CEL_ID_SEARCH_S );
	CATS_LoadResourceCellAnmArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_zukan_gs_obj_s_lz_NANR, 1, ANM_ID_SEARCH_S );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面リソース解放
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchPageMainResFree( ZKN2_WORK * wk )
{
	PokeIconResFree( wk, ZKN2_POKEICON_ADD_MAX*2 );
	ZukanObjResFreeMain( wk );
	LangIconResFreeMain( wk );

	CATS_FreeResourceChar( wk->crp, CHR_ID_SEARCH_FORM_S );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_SEARCH_FORM_S );
	CATS_FreeResourceCell( wk->crp, CEL_ID_SEARCH_FORM_S );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_SEARCH_FORM_S );

	CATS_FreeResourceChar( wk->crp, CHR_ID_SEARCH_FORM );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_SEARCH_FORM );
	CATS_FreeResourceCell( wk->crp, CEL_ID_SEARCH_FORM );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_SEARCH_FORM );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面リストページＯＢＪ設定
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchPageListLoad( ZKN2_WORK * wk )
{
	TCATS_OBJECT_ADD_PARAM_S prm;
	u32	i;

	PokeGraDummyResLoad( wk );
	PokeFootResLoad( wk );
	TypeIconResLoad( wk );
	ZukanObjResLoadSub( wk );
	LangIconResLoadSub( wk );

	wk->cap[ZKN2_OBJ_SEARCH_BALL_S] = CATS_ObjectAdd_S_SubDistance(
										wk->csp, wk->crp,
										&ClaTopPagePrm[ZKN2_OBJ_BALL_S],
										ZKN2_SUB_ACTOR_DISTANCE );
	wk->cap[ZKN2_OBJ_SEARCH_NAZOPOKE_S] = CATS_ObjectAdd_S_SubDistance(
											wk->csp, wk->crp,
											&ClaTopPagePrm[ZKN2_OBJ_NAZOPOKE_S],
											ZKN2_SUB_ACTOR_DISTANCE );

	PokeGraObjAdd( wk, ZKN2_OBJ_SEARCH_POKEGRA );
	PokeFootAdd( wk, ZKN2_OBJ_SEARCH_POKEFOOT );
	TypeIconAdd( wk, ZKN2_OBJ_SEARCH_TYPEICON1 );

	prm = ClaListLangIconSPrm;
	for( i=ZKN2_OBJ_SEARCH_LANGICON1; i<=ZKN2_OBJ_SEARCH_LANGICON6; i++ ){
		prm.x = LISTSUB_LANGICON_PX + LISTSUB_LANGICON_SX * (i-ZKN2_OBJ_SEARCH_LANGICON1);
		LangIconAdd( wk, i, &prm );
		CATS_ObjectPaletteSetCap(
			wk->cap[i],
			CATS_PlttID_NoGet( wk->crp, PAL_ID_LANGICON_S, NNS_G2D_VRAM_TYPE_2DSUB ) );
	}

	for( i=ZKN2_OBJ_SEARCH_BALL_S; i<=ZKN2_OBJ_SEARCH_LANGICON6; i++ ){
		CATS_ObjectEnableCap( wk->cap[i], ACT_OFF );
		CATS_ObjectBGPriSetCap( wk->cap[i], 2 );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面リストページリソース解放
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchPageListDelete( ZKN2_WORK * wk )
{
	PokeGraDummyResFree( wk );
	PokeFootResFree( wk );
	TypeIconResFree( wk );
	ZukanObjResFreeSub( wk );
	LangIconResFreeSub( wk );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面ＯＢＪ追加
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchPageMainObjAdd( ZKN2_WORK * wk )
{
	TCATS_OBJECT_ADD_PARAM_S prm;
	u16	i, j;

	for( i=ZKN2_OBJ_SEARCH_CURSOR; i<=ZKN2_OBJ_SEARCH_LISTICON; i++ ){
		wk->cap[i] = CATS_ObjectAdd_S(
						wk->csp, wk->crp, &ClaSearchPagePrm[i] );
		ZKN2OBJ_Vanish( wk, i, FALSE );
	}

	wk->cap[ZKN2_OBJ_SEARCH_FORM_SUB] = CATS_ObjectAdd_S_SubDistance(
											wk->csp, wk->crp,
											&ClaSearchFormSPrm,
											ZKN2_SUB_ACTOR_DISTANCE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_FORM_SUB, FALSE );

	wk->cap[ZKN2_OBJ_SEARCH_YADON] = CATS_ObjectAdd_S_SubDistance(
										wk->csp, wk->crp,
										&ClaSearchPagePrm[ZKN2_OBJ_SEARCH_YADON],
										ZKN2_SUB_ACTOR_DISTANCE );
	wk->cap[ZKN2_OBJ_SEARCH_GAGE] = CATS_ObjectAdd_S_SubDistance(
										wk->csp, wk->crp,
										&ClaSearchPagePrm[ZKN2_OBJ_SEARCH_GAGE],
										ZKN2_SUB_ACTOR_DISTANCE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_GAGE, FALSE );

	prm = ClaSearchFormPrm;
	for( i=ZKN2_OBJ_SEARCH_FORM_SEL; i<=ZKN2_OBJ_SEARCH_FORM_13; i++ ){
		if( i == ZKN2_OBJ_SEARCH_FORM_SEL ){
			prm.x = SEARCH_FORM_MAIN_PX;
			prm.y = SEARCH_FORM_MAIN_PY;
			wk->cap[i] = CATS_ObjectAdd_S( wk->csp, wk->crp, &prm );
			if( wk->search_prm[ZKN2_SEARCH_PRM_FORM] == ZKN2LIST_SEARCH_DEF_FORM ){
				ZKN2OBJ_Vanish( wk, i, FALSE );
			}else{
				ZKN2OBJ_AnmSet( wk, i, wk->search_prm[ZKN2_SEARCH_PRM_FORM] );
			}
		}else{
			j = i - ZKN2_OBJ_SEARCH_FORM_00;
			prm.x = SEARCH_FORM_LIST_PX + j % SEARCH_FORM_LIST_X_MAX * SEARCH_FORM_LIST_SX;
			prm.y = SEARCH_FORM_LIST_PY + j / SEARCH_FORM_LIST_X_MAX * SEARCH_FORM_LIST_SY;
			wk->cap[i] = CATS_ObjectAdd_S( wk->csp, wk->crp, &prm );
			ZKN2OBJ_AnmSet( wk, i, j );
			ZKN2OBJ_Vanish( wk, i, FALSE );
		}
	}

	PokeIconObjAdd( wk, ZKN2_OBJ_SEARCH_POKEICON );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面ＯＢＪ全削除
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchObjDelete( ZKN2_WORK * wk )
{
	ClactDelAll( wk );

	SearchPageMainResFree( wk );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面リストに必要ないＯＢＪを削除
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchInputObjDelete( ZKN2_WORK * wk )
{
	ClactDel( wk, ZKN2_OBJ_SEARCH_YADON );
	ClactDel( wk, ZKN2_OBJ_SEARCH_GAGE );

	CATS_FreeResourceChar( wk->crp, CHR_ID_SEARCH_S );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_SEARCH_S );
	CATS_FreeResourceCell( wk->crp, CEL_ID_SEARCH_S );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_SEARCH_S );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面の姿ＯＢＪセット
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_MainFormSet( ZKN2_WORK * wk )
{
	if( wk->search_prm[ZKN2_SEARCH_PRM_FORM] == ZKN2LIST_SEARCH_DEF_FORM ){
		ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_FORM_SEL, FALSE );
	}else{
		ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_FORM_SEL, TRUE );
		ZKN2OBJ_AnmSet( wk, ZKN2_OBJ_SEARCH_FORM_SEL, wk->search_prm[ZKN2_SEARCH_PRM_FORM] );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 姿ＯＢＪ非表示
 *
 * @param	wk		図鑑画面ワーク
 * @param	flg		TRUE = 選択用の姿ＯＢＪも非表示にする
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchFormOff( ZKN2_WORK * wk, BOOL flg )
{
	u32	i;

	if( flg == TRUE ){
		ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_FORM_SEL, FALSE );
	}

	for( i=ZKN2_OBJ_SEARCH_FORM_00; i<=ZKN2_OBJ_SEARCH_FORM_13; i++ ){
		ZKN2OBJ_Vanish( wk, i, FALSE );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 姿ＯＢＪ表示
 *
 * @param	wk		図鑑画面ワーク
 * @param	flg		TRUE = 検索メイン画面, FALSE = 姿選択画面
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchFormOn( ZKN2_WORK * wk, BOOL flg )
{
	u32	i;

	ZKN2OBJ_MainFormSet( wk );

	if( flg == TRUE ){
		CATS_ObjectPosSetCap(
			wk->cap[ZKN2_OBJ_SEARCH_FORM_SEL],
			SEARCH_FORM_MAIN_PX, SEARCH_FORM_MAIN_PY );
		for( i=ZKN2_OBJ_SEARCH_FORM_00; i<=ZKN2_OBJ_SEARCH_FORM_13; i++ ){
			ZKN2OBJ_Vanish( wk, i, FALSE );
		}
	}else{
		CATS_ObjectPosSetCap(
			wk->cap[ZKN2_OBJ_SEARCH_FORM_SEL],
			SEARCH_FORM_LIST_SEL_PX, SEARCH_FORM_LIST_SEL_PY );
		for( i=ZKN2_OBJ_SEARCH_FORM_00; i<=ZKN2_OBJ_SEARCH_FORM_13; i++ ){
			ZKN2OBJ_Vanish( wk, i, TRUE );
		}
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 検索サイズ選択ＯＢＪ表示切替
 *
 * @param	wk		図鑑画面ワーク
 * @param	flg		表示フラグ ( TRUE = 表示 )
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchSizeVanish( ZKN2_WORK * wk, BOOL flg )
{
	u32	i;

	for( i=ZKN2_OBJ_SEARCH_MAX_LA; i<=ZKN2_OBJ_SEARCH_MIN_NUM4; i++ ){
		ZKN2OBJ_Vanish( wk, i, flg );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 検索サイズ選択ＯＢＪ配置
 *
 * @param	wk			図鑑画面ワーク
 * @param	prm_min		パラメータ最小値
 * @param	prm_max		パラメータ最大値
 * @param	mode		高さ／重さ
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SearchSizePut( ZKN2_WORK * wk, u32 prm_min, u32 prm_max, u32 mode )
{
	u32	x;

	x = ZKN2OBJ_SearchMaxMinPosGet( wk, prm_max );
	ZKN2OBJ_SearchMaxMinMove( wk, x, ZKN2_OBJ_SEARCH_MAX_CUR, TRUE );
	x = ZKN2OBJ_SearchMaxMinPosGet( wk, prm_min );
	ZKN2OBJ_SearchMaxMinMove( wk, x, ZKN2_OBJ_SEARCH_MIN_CUR, FALSE );

	if( mode == ZKN2OBJ_SEARCH_SIZMODE_HEIGHT ){
		ZKN2OBJ_SearchMaxMinNumChange( wk, ZKN2_OBJ_SEARCH_MAX_NUM1, wk->hw_dot[prm_max].height );
		ZKN2OBJ_SearchMaxMinNumChange( wk, ZKN2_OBJ_SEARCH_MIN_NUM1, wk->hw_dot[prm_min].height );
	}else{
		ZKN2OBJ_SearchMaxMinNumChange( wk, ZKN2_OBJ_SEARCH_MAX_NUM1, wk->hw_dot[prm_max].weight );
		ZKN2OBJ_SearchMaxMinNumChange( wk, ZKN2_OBJ_SEARCH_MIN_NUM1, wk->hw_dot[prm_min].weight );
	}

	ZKN2OBJ_SearchMaxMinArrowCahnge( wk, prm_max, ZKN2_OBJ_SEARCH_MAX_LA );
	ZKN2OBJ_SearchMaxMinArrowCahnge( wk, prm_min, ZKN2_OBJ_SEARCH_MIN_LA );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面ＯＢＪ表示
 *
 * @param	wk			図鑑画面ワーク
 * @param	mode		表示モード（ページ）
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchMode( ZKN2_WORK * wk, u32 mode )
{
	switch( mode ){
	case ZKN2OBJ_SEARCH_MAIN:
		SearchFormOn( wk, TRUE );
		SearchSizeVanish( wk, FALSE );
		break;

	case ZKN2OBJ_SEARCH_FORM:
		SearchFormOn( wk, FALSE );
		SearchSizeVanish( wk, FALSE );
		break;

	case ZKN2OBJ_SEARCH_HEIGHT:
		SearchFormOff( wk, TRUE );
		SearchSizeVanish( wk, TRUE );
		SearchSizePut(
			wk,
			wk->search_prm[ZKN2_SEARCH_PRM_HEIGHT_L],
			wk->search_prm[ZKN2_SEARCH_PRM_HEIGHT_H],
			ZKN2OBJ_SEARCH_SIZMODE_HEIGHT );
		break;

	case ZKN2OBJ_SEARCH_WEIGHT:
		SearchFormOff( wk, TRUE );
		SearchSizeVanish( wk, TRUE );
		SearchSizePut(
			wk,
			wk->search_prm[ZKN2_SEARCH_PRM_WEIGHT_L],
			wk->search_prm[ZKN2_SEARCH_PRM_WEIGHT_H],
			ZKN2OBJ_SEARCH_SIZMODE_WEIGHT );
		break;

	default:
		SearchFormOff( wk, TRUE );
		SearchSizeVanish( wk, FALSE );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面サイズ変更ＯＢＪ移動
 *
 * @param	wk			図鑑画面ワーク
 * @param	x			Ｘ座標
 * @param	id			OBJ ID
 * @param	flg			カーソル移動フラグ
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchMaxMinMove( ZKN2_WORK * wk, u32 x, u32 id, BOOL flg )
{
	s16	obj_x, obj_y;

	CATS_ObjectPosGetCap( wk->cap[id], &obj_x, &obj_y );

	if( x == 0 ){
		x = obj_x;
	}else if( x < SEARCH_HW_MIN_X ){
		x = SEARCH_HW_MIN_X;
	}else if( x > SEARCH_HW_MAX_X ){
		x = SEARCH_HW_MAX_X;
	}

	// バー
	CATS_ObjectPosGetCap( wk->cap[id], &obj_x, &obj_y );
	CATS_ObjectPosSetCap( wk->cap[id], x, obj_y );
	// 数字
	CATS_ObjectPosGetCap( wk->cap[id+1], &obj_x, &obj_y );
	CATS_ObjectPosSetCap(
		wk->cap[id+1], x+SEARCH_HW_NUM_PX+SEARCH_HW_NUM_SX*0, obj_y );
	CATS_ObjectPosSetCap(
		wk->cap[id+2], x+SEARCH_HW_NUM_PX+SEARCH_HW_NUM_SX*1, obj_y );
	CATS_ObjectPosSetCap(
		wk->cap[id+3], x+SEARCH_HW_NUM_PX+SEARCH_HW_NUM_SX*2, obj_y );
	CATS_ObjectPosSetCap(
		wk->cap[id+4], x+SEARCH_HW_NUM_PX+SEARCH_HW_NUM_SX*4, obj_y );
	// カーソル
	if( flg == TRUE ){
		CATS_ObjectPosGetCap( wk->cap[ZKN2_OBJ_SEARCH_CURSOR], &obj_x, &obj_y );
		CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_SEARCH_CURSOR], x + SEARCH_HW_CUR_PX, obj_y );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面サイズ数字ＯＢＪアニメ変更
 *
 * @param	wk		図鑑画面ワーク
 * @param	id		OBJ ID
 * @param	num		サイズ
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchMaxMinNumChange( ZKN2_WORK * wk, u32 id, u32 num )
{
	u32	i, j, k;
	BOOL flg;

	flg = FALSE;
	k   = 1000;
	for( i=0; i<4; i++ ){
		j = num / k;
		if( j != 0 || flg == TRUE ){
			flg = TRUE;
			ZKN2OBJ_AnmSet( wk, id+i, ZKN2OBJ_M_ANM_NO_0 + j );
			ZKN2OBJ_Vanish( wk, id+i, TRUE );
		}else{
			ZKN2OBJ_Vanish( wk, id+i, FALSE );
		}
		num %= k;
		k /= 10;
		if( i == 1 ){ flg = TRUE; }
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面サイズ変更矢印ＯＢＪアニメ変更
 *
 * @param	wk		図鑑画面ワーク
 * @param	prm		サイズ値
 * @param	id		OBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchMaxMinArrowCahnge( ZKN2_WORK * wk, u32 prm, u32 id )
{
	if( prm == 0 ){
		ZKN2OBJ_AnmSet( wk, id+0, ZKN2OBJ_M_ANM_OMOSA_L_OFF );
		ZKN2OBJ_AnmSet( wk, id+1, ZKN2OBJ_M_ANM_OMOSA_R );
	}else if( prm == ZKN2_HW_DOT_MAX ){
		ZKN2OBJ_AnmSet( wk, id+0, ZKN2OBJ_M_ANM_OMOSA_L );
		ZKN2OBJ_AnmSet( wk, id+1, ZKN2OBJ_M_ANM_OMOSA_R_OFF );
	}else{
		ZKN2OBJ_AnmSet( wk, id+0, ZKN2OBJ_M_ANM_OMOSA_L );
		ZKN2OBJ_AnmSet( wk, id+1, ZKN2OBJ_M_ANM_OMOSA_R );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面サイズ変更ＯＢＪの位置取得
 *
 * @param	wk		図鑑画面ワーク
 * @param	id		OBJ ID
 *
 * @return	位置
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2OBJ_SearchPosMaxMinGet( ZKN2_WORK * wk, u32 id )
{
	s16	x, y;

	CATS_ObjectPosGetCap( wk->cap[id], &x, &y );
	return ( x - SEARCH_HW_MIN_X );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面サイズからサイズ変更ＯＢＪの表示座標を取得
 *
 * @param	wk		図鑑画面ワーク
 * @param	prm		サイズ値
 *
 * @return	座標
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2OBJ_SearchMaxMinPosGet( ZKN2_WORK * wk, u32 prm )
{
	return ( prm + SEARCH_HW_MIN_X );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面用カバースイッチセット
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchCoverSwithPut( ZKN2_WORK * wk )
{
	s16	x, y;

	if( wk->zenkoku_mode == TRUE ){
		ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_SWITCH, TRUE );
		ZKN2OBJ_CoverSwithPut( wk, ZKN2_OBJ_SEARCH_SWITCH );

		CATS_ObjectPosGetCap( wk->cap[ZKN2_OBJ_SEARCH_SWITCH], &x, &y );
		CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_SEARCH_SWITCH], x-18*16, y );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面用カバースイッチ移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	spd		移動速度
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchCoverSwithMove( ZKN2_WORK * wk, s16 spd )
{
	s16	x, y;

	// スイッチ
	CATS_ObjectPosGetCap( wk->cap[ZKN2_OBJ_SEARCH_SWITCH], &x, &y );
	CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_SEARCH_SWITCH], x+spd, y );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面リストＯＢＪ表示切替
 *
 * @param	wk		図鑑画面ワーク
 * @param	flg		表示フラグ ( TRUE = 表示 )
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchPageListVanish( ZKN2_WORK * wk, BOOL flg )
{
	u32	i;

	if( flg == TRUE ){
		for( i=ZKN2_OBJ_SEARCH_BALL_S; i<=ZKN2_OBJ_SEARCH_LANGICON6; i++ ){
			ZKN2OBJ_Vanish( wk, i, TRUE );
		}
		ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_FORM_SUB, FALSE );
	}else{
		for( i=ZKN2_OBJ_SEARCH_BALL_S; i<=ZKN2_OBJ_SEARCH_LANGICON6; i++ ){
			ZKN2OBJ_Vanish( wk, i, FALSE );
		}
		ZKN2OBJ_SearchFormSubMoveInit( wk );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面姿ＯＢＪスクロール設定
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchFormSubMoveInit( ZKN2_WORK * wk )
{
	if( wk->search_prm[ZKN2_SEARCH_PRM_FORM] == ZKN2LIST_SEARCH_DEF_FORM ){
		ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_FORM_SUB, FALSE );
	}else{
		ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_FORM_SUB, TRUE );
		ZKN2OBJ_AnmSet( wk, ZKN2_OBJ_SEARCH_FORM_SUB, wk->search_prm[ZKN2_SEARCH_PRM_FORM] );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 検索画面姿ＯＢＪスクロール
 *
 * @param	wk		図鑑画面ワーク
 * @param	mv		移動値
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchFormSubMove( ZKN2_WORK * wk, s16 mv )
{
	s16	x, y;

	CATS_ObjectPosGetCap( wk->cap[ZKN2_OBJ_SEARCH_FORM_SEL], &x, &y );
	CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_SEARCH_FORM_SEL], x, y+mv );
	CATS_ObjectPosGetCap( wk->cap[ZKN2_OBJ_SEARCH_FORM_SUB], &x, &y );
	CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_SEARCH_FORM_SUB], x, y+mv );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索条件アイコン移動設定
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchListIconMoveUInit( ZKN2_WORK * wk )
{
	CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_SEARCH_LISTICON], LIST_POKEICON_PX, LIST_POKEICON_PY-15*8 );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_LISTICON, TRUE );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索条件アイコン移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	mv		移動値
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchListIconMove( ZKN2_WORK * wk, s8 mv )
{
	s16	x, y;

	CATS_ObjectPosGetCap( wk->cap[ZKN2_OBJ_SEARCH_LISTICON], &x, &y );
	CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_SEARCH_LISTICON], x, y+mv );
}

//--------------------------------------------------------------------------------------------
/**
 * 検索条件アイコンデフォルト座標セット
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SearchListIconDefPosSet( ZKN2_WORK * wk )
{
	CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_SEARCH_LISTICON], LIST_POKEICON_PX, LIST_POKEICON_PY );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SEARCH_LISTICON, TRUE );
}


//============================================================================================
/*
	詳細
*/
//============================================================================================

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面：フォルムと性別取得
 *
 * @param	wk		図鑑画面ワーク
 * @param	pos		見た順の何番目か
 * @param	frm		フォルム
 * @param	sex		性別
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void FormSexGet( ZKN2_WORK * wk, u32 pos, u8 * frm, u8 * sex )
{
	if( wk->detail_form[pos] & ZKN2MAIN_FORM_EXTRA ){
		// ピチュー
		if( wk->detail_mons == MONSNO_PITYUU ){
			// ギザミミ
			switch( ( wk->detail_form[pos] ^ ZKN2MAIN_FORM_EXTRA ) ){
			case 0:		// ♂
				*frm = 0;
				*sex = PARA_MALE;
				break;
			case 1:		// ♀
				*frm = 0;
				*sex = PARA_FEMALE;
				break;
			case 2:		// ギザミミ
				*frm = 1;
				*sex = PARA_FEMALE;		// 強制的にメスにする
			}
		}else{
			*frm = wk->detail_form[pos] ^ ZKN2MAIN_FORM_EXTRA;
			*sex = ZukanWork_GetPokeSexFlag( wk->dat->zukan_work, wk->detail_mons, ZUKAN_WORK_SEX_FIRST );
		}
	}else{
		*frm = 0;
		switch( wk->detail_form[pos] ){
		case ZKN2MAIN_FORM_MALE:		// ♂
			*sex = PARA_MALE;
			break;
		case ZKN2MAIN_FORM_FAMALE:		// ♀
			*sex = PARA_FEMALE;
			break;
		case ZKN2MAIN_FORM_SEX_UNKNOWN:	// 性別不明
		default:
			*sex = PARA_UNK;
			break;
		}
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面OBJ初期化
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_DetailInit( ZKN2_WORK * wk )
{
	ZukanObjResLoadMain( wk );

	wk->cap[ZKN2_OBJ_DETAIL_CURSOR] = CATS_ObjectAdd_S( wk->csp, wk->crp, &ClaDetailPagePrm );
	CATS_ObjectPaletteSetCap( wk->cap[ZKN2_OBJ_DETAIL_CURSOR], 4 );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_DETAIL_CURSOR, FALSE );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面OBJ削除
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_DetailDelete( ZKN2_WORK * wk )
{
	ClactDel( wk, ZKN2_OBJ_DETAIL_CURSOR );

	ZukanObjResFreeMain( wk );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面カーソル配置
 *
 * @param	wk		図鑑画面ワーク
 * @param	pos		カーソル位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_DetailCursorPut( ZKN2_WORK * wk, u32 pos )
{
	ObjPosSet(
		wk, ZKN2_OBJ_DETAIL_CURSOR,
		DETAIL_CURSOR_PX+pos*DETAIL_CURSOR_SX, DETAIL_CURSOR_PY, OBJ_PUT_DISP_MAIN );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページＯＢＪ初期化
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_PlacePageInit( ZKN2_WORK * wk )
{
	u32	i;
	u8	frm, sex;

	PlacePageResLoad( wk );

	for( i=ZKN2_OBJ_ENC_POKEICON; i<=ZKN2_OBJ_ENC_RAIL; i++ ){
		wk->cap[i] = ObjAdd( wk, &ClaEncountPagePrm[i-ZKN2_OBJ_ENC_POKEICON] );
	}

	ZKN2OBJ_EncFaceAnmChange( wk, TRUE );

	FormSexGet( wk, 0, &frm, &sex );
	PokeIconChangeSub( wk, wk->detail_mons, frm, ZKN2_OBJ_ENC_POKEICON );

	PlaceMyFaceMove( wk );

	ZON2OBJ_EncountListBarInit( wk );

	PlacePosAdd( wk );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページＯＢＪ削除
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_PlacePageDelete( ZKN2_WORK * wk )
{
	u32	i;

	for( i=ZKN2_OBJ_ENC_POKEICON; i<ZKN2_OBJ_ENC_MAX; i++ ){
		ClactDel( wk, i );
	}

	PlacePageResFree( wk );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページリソース読み込み
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PlacePageResLoad( ZKN2_WORK * wk )
{
	// ポケアイコン（サブ）
	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_pokeicon_dmy_lz_NCGR,
		1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_POKEICON );
	CATS_LoadResourcePlttWorkArcH(
		wk->pfd, FADE_SUB_OBJ,
		wk->csp, wk->crp,
		wk->pokeicon_ah, PokeIconPalArcIndexGet(), 0,
		PALSIZ_POKEICON, NNS_G2D_VRAM_TYPE_2DSUB, PAL_ID_POKEICON_S );
	CATS_LoadResourceCellArcH(
		wk->csp, wk->crp,
		wk->pokeicon_ah, PokeIcon64kCellArcIndexGet(), 0, CEL_ID_POKEICON );
	CATS_LoadResourceCellAnmArcH(
		wk->csp, wk->crp,
		wk->pokeicon_ah, PokeIcon64kCellAnmArcIndexGet(), 0, ANM_ID_POKEICON );

	// 顔アイコン（サブ）
	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_face_lz_NCGR,
		1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_MYICON_S );
	CATS_LoadResourcePlttWorkArcH(
		wk->pfd, FADE_SUB_OBJ,
		wk->csp, wk->crp,
		wk->graphic_ah, NARC_zukan_gra_face_NCLR, 0,
		PALSIZ_FACEICON, NNS_G2D_VRAM_TYPE_2DSUB, PAL_ID_MYICON_S );
	CATS_LoadResourceCellArcH(
		wk->csp, wk->crp,
		wk->graphic_ah, NARC_zukan_gra_face_lz_NCER, 1, CEL_ID_MYICON );
	CATS_LoadResourceCellAnmArcH(
		wk->csp, wk->crp,
		wk->graphic_ah, NARC_zukan_gra_face_lz_NANR, 1, ANM_ID_MYICON );

	// 出現場所（サブ）
	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_pos_lz_NCGR,
		1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_POS_S );
	CATS_LoadResourcePlttWorkArcH(
		wk->pfd, FADE_SUB_OBJ,
		wk->csp, wk->crp,
		wk->graphic_ah, NARC_zukan_gra_pos_NCLR, 0,
		PALSIZ_POS_S, NNS_G2D_VRAM_TYPE_2DSUB, PAL_ID_POS_S );
	CATS_LoadResourceCellArcH(
		wk->csp, wk->crp,
		wk->graphic_ah, NARC_zukan_gra_pos_lz_NCER, 1, CEL_ID_POS );
	CATS_LoadResourceCellAnmArcH(
		wk->csp, wk->crp,
		wk->graphic_ah, NARC_zukan_gra_pos_lz_NANR, 1, ANM_ID_POS );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページリソース削除
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PlacePageResFree( ZKN2_WORK * wk )
{
	CATS_FreeResourceChar( wk->crp, CHR_ID_POKEICON );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_POKEICON_S );
	CATS_FreeResourceCell( wk->crp, CEL_ID_POKEICON );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_POKEICON );

	CATS_FreeResourceChar( wk->crp, CHR_ID_MYICON_S );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_MYICON_S );
	CATS_FreeResourceCell( wk->crp, CEL_ID_MYICON );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_MYICON );

	CATS_FreeResourceChar( wk->crp, CHR_ID_POS_S );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_POS_S );
	CATS_FreeResourceCell( wk->crp, CEL_ID_POS );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_POS );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページ時間帯カーソル移動
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_PlaceTimeCursorMove( ZKN2_WORK * wk )
{
	ObjPosSet(
		wk, ZKN2_OBJ_ENC_TIME_CURSOR,
		PLACE_TIME_CURSOR_PX,
		PLACE_TIME_CURSOR_PY + PLACE_TIME_CURSOR_SY * wk->detail_place_time,
		NNS_G2D_VRAM_TYPE_2DMAIN );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページ 場所リストバー初期化
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZON2OBJ_EncountListBarInit( ZKN2_WORK * wk )
{
	DetailListBarAnmChg(
		wk, ZKN2_OBJ_ENC_BAR, wk->enc_data.all.num,
		PlaceListBarAnmMaxTbl, NELEMS(PlaceListBarAnmMaxTbl) );
	ZKN2OBJ_PlaceListBarPosYSet( wk );
	ZKN2OBJ_DetailListArrowAnmChange(
		wk, wk->detail_place_pos, wk->enc_data.all.num, ZKN2_OBJ_ENC_ARROW_U );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページ 主人公アイコンの顔移動
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PlaceMyFaceMove( ZKN2_WORK * wk )
{
	u16	gx, gz;

	gx = wk->dat->player_x / MBLOCK_GRID;
	gz = wk->dat->player_z / MBLOCK_GRID;

	if( gx >= FACE_ICON_KANTO_GRID ){
		gx = gx - FACE_ICON_KANTO_GRID + 1;		// 左１グリッドはジョウトと共用なので＋１
	}

	ObjPosSet(
		wk, ZKN2_OBJ_ENC_FACE,
		gx * 8 + FACE_ICON_PX,
		gz * 8 + FACE_ICON_PY,
		NNS_G2D_VRAM_TYPE_2DSUB );

	ZKN2OBJ_MyFacePut( wk );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページ 主人公アイコンの配置
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_MyFacePut( ZKN2_WORK * wk )
{
	if( wk->detail_place_mode == 0 ){
		if( ( wk->dat->player_x / MBLOCK_GRID ) >= FACE_ICON_KANTO_GRID ){
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_ENC_FACE, FALSE );
		}else{
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_ENC_FACE, TRUE );
		}
	}else{
		if( ( wk->dat->player_x / MBLOCK_GRID ) >= FACE_ICON_KANTO_GRID ){
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_ENC_FACE, TRUE );
		}else{
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_ENC_FACE, FALSE );
		}
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページ 分布位置ＯＢＪ追加
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PlacePosAdd( ZKN2_WORK * wk )
{
	u32	i;

	for( i=ZKN2_OBJ_ENC_POS; i<ZKN2_OBJ_ENC_MAX; i++ ){
		wk->cap[i] = ObjAdd( wk, &ClaEncPosPrm );
		BlendModeSet( wk, i, TRUE );
		ZKN2OBJ_Vanish( wk, i, FALSE );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページ フィールド分布位置ＯＢＪデータ取得
 *
 * @param	wk		図鑑画面ワーク
 * @param	map		マップ番号
 * @param	x		Ｘ座標
 * @param	y		Ｙ座標
 * @param	anm		アニメ番号
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void FieldPlacePosParamGet( ZKN2_WORK * wk, u32 map, s16 * x, s16 * y, u8 * anm )
{
	u8	gx, gy, sx, sy;

	// ２番道路
	if( ZKN2MAIN_ZoneIDRoad2Check(map) == TRUE ){
		gx = R02_GRID_X;
		gy = R02_GRID_Y;
		sx = R02_SIZE_X;
		sy = R02_SIZE_Y;
	// 10番道路
	}else if( ZKN2MAIN_FldZoneIDGet(map) == ZONE_ID_R10 ){
		gx = wk->fld_grid[map].gridx;
		gy = wk->fld_grid[map].gridy;
		sx = 1;
		sy = 2;
	// 16番道路
	}else if( ZKN2MAIN_ZoneIDRoad16Check(map) == TRUE ){
		gx = R16_GRID_X;
		gy = R16_GRID_Y;
		sx = R16_SIZE_X;
		sy = R16_SIZE_Y;
	}else{
		gx = wk->fld_grid[map].gridx;
		gy = wk->fld_grid[map].gridy;
		sx = wk->fld_grid[map].sizex;
		sy = wk->fld_grid[map].sizey;
	}

	if( sx == 1 ){
		if( sy == 1 ){
			*anm = PLACE_POS_ANM_1x1;
		}else if( sy == 2 ){
			*anm = PLACE_POS_ANM_1x2;
		}else if( sy == 3 ){
			*anm = PLACE_POS_ANM_1x3;
		}else if( sy == 4 ){
			*anm = PLACE_POS_ANM_1x4;
		}else if( sy == 5 ){
			*anm = PLACE_POS_ANM_1x5;
		}
	}else if( sx == 2 ){
		if( sy == 1 ){
			*anm = PLACE_POS_ANM_2x1;
		}else{
			*anm = PLACE_POS_ANM_2x2;
		}
	}else if( sx == 3 ){
		if( sy == 1 ){
			*anm = PLACE_POS_ANM_3x1;
		}else{
			*anm = PLACE_POS_ANM_3x2;
		}
	}else if( sx == 4 ){
		*anm = PLACE_POS_ANM_4x1;
	}else if( sx == 5 ){
		*anm = PLACE_POS_ANM_5x1;
	}else if( sx == 6 ){
		*anm = PLACE_POS_ANM_6x1;
	}else{
		*anm = PLACE_POS_ANM_1x1;	// 一応。
	}
	*x = ( gx - ( wk->detail_place_mode * 22 ) ) * 8 + sx * 8 / 2 + ENC_MAP_DEF_PX;
	*y = gy * 8 + sy * 8 / 2 + ENC_MAP_DEF_PY;
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページ ダンジョン分布位置ＯＢＪデータ取得
 *
 * @param	wk		図鑑画面ワーク
 * @param	map		マップ番号
 * @param	x		Ｘ座標
 * @param	y		Ｙ座標
 * @param	anm		アニメ番号
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void DungeonPlacePosParamGet( ZKN2_WORK * wk, u32 map, s16 * x, s16 * y, u8 * anm )
{
	u32	zoneID;

	*x = ( wk->dan_grid[map].gridx - ( wk->detail_place_mode * 22 ) ) * 8 + FACE_ICON_PX;
	*y = wk->dan_grid[map].gridy * 8 + FACE_ICON_PY;

	zoneID = ZKN2MAIN_DanZoneIDGet( map );

	// チャンピオンロード
	if( zoneID == ZONE_ID_D43R0101 || zoneID == ZONE_ID_D43R0102 || zoneID == ZONE_ID_D43R0103 ){
		*anm = PLACE_POS_ANM_1x2;
		*y += 4;
	// 自然公園
	}else if( zoneID == ZONE_ID_D22R0101 || zoneID == ZONE_ID_D22R0102 ){
		*anm = PLACE_POS_ANM_1x1;
		*x += 4;
		*y += 4;
	// アルフの遺跡
	}else if( zoneID == ZONE_ID_D24R0101 || zoneID == ZONE_ID_D24R0205 ||
			  zoneID == ZONE_ID_D24R0216 || zoneID == ZONE_ID_D24R0217 || zoneID == ZONE_ID_D24R0218 ){
		*anm = PLACE_POS_ANM_1x2;
		*y += 4;
	}else{
		*anm = PLACE_POS_ANM_1x1;
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページ 分布位置ＯＢＪ表示切替（リスト選択時）
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_PlacePosChange( ZKN2_WORK * wk )
{
	BOOL face_mv;
	s16	face_x, face_y;
	u16	i;
	s16	x, y;
	u8	anm;
	u32	exit_flg;

	face_mv = FALSE;
	ObjPosGet( wk, ZKN2_OBJ_ENC_FACE, &face_x, &face_y, NNS_G2D_VRAM_TYPE_2DSUB );

	exit_flg = 0;

	// 全体
	if( wk->detail_place_pos == 0 ){
		for( i=1; i<wk->enc_data.all.num; i++ ){
			// フィールド
			if( ZKN2MAIN_EncPosTypeGet( wk, i ) == 0 ){
				FieldPlacePosParamGet( wk, wk->enc_data.all.map[i], &x, &y, &anm );
			// ダンジョン
			}else{
				DungeonPlacePosParamGet( wk, wk->enc_data.all.map[i], &x, &y, &anm );
				EncExitPosCheck( ZKN2MAIN_DanZoneIDGet(wk->enc_data.all.map[i]), &exit_flg );
			}
			ObjPosSet( wk, ZKN2_OBJ_ENC_POS+i-1, x, y, NNS_G2D_VRAM_TYPE_2DSUB );
			ZKN2OBJ_AnmSet( wk, ZKN2_OBJ_ENC_POS+i-1, anm );
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_ENC_POS+i-1, TRUE );

			if( face_x >= ( x - EncAreObjSize[anm][0]/2 ) && face_x < ( x + EncAreObjSize[anm][0]/2 ) &&
				face_y >= ( y - EncAreObjSize[anm][1]/2 ) && face_y < ( y + EncAreObjSize[anm][1]/2 ) ){
				face_mv = TRUE;
			}
		}
		// 出口にもＯＢＪセット
		EncExitObjPut( wk, exit_flg, ZKN2_OBJ_ENC_POS+i-1 );
		if( face_mv == FALSE && exit_flg != 0 ){
			face_mv = EncExitFaceCheck( wk, ZKN2_OBJ_ENC_POS+i-1, face_x, face_y );
		}
	// 個別
	}else{
		ZKN2OBJ_PlacePosAllOff( wk );
		// フィールド
		if( ZKN2MAIN_EncPosTypeGet( wk, wk->detail_place_pos ) == 0 ){
			FieldPlacePosParamGet( wk, wk->enc_data.all.map[wk->detail_place_pos], &x, &y, &anm );
			ObjPosSet( wk, ZKN2_OBJ_ENC_POS, x, y, NNS_G2D_VRAM_TYPE_2DSUB );
			ZKN2OBJ_AnmSet( wk, ZKN2_OBJ_ENC_POS, anm );
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_ENC_POS, TRUE );

			if( face_x >= ( x - EncAreObjSize[anm][0]/2 ) && face_x < ( x + EncAreObjSize[anm][0]/2 ) &&
				face_y >= ( y - EncAreObjSize[anm][1]/2 ) && face_y < ( y + EncAreObjSize[anm][1]/2 ) ){
				face_mv = TRUE;
			}
		// ダンジョン
		}else{
			DungeonPlacePosParamGet( wk, wk->enc_data.all.map[wk->detail_place_pos], &x, &y, &anm );
			EncExitPosCheck( ZKN2MAIN_DanZoneIDGet(wk->enc_data.all.map[wk->detail_place_pos]), &exit_flg );
			ObjPosSet( wk, ZKN2_OBJ_ENC_POS, x, y, NNS_G2D_VRAM_TYPE_2DSUB );
			ZKN2OBJ_AnmSet( wk, ZKN2_OBJ_ENC_POS, anm );
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_ENC_POS, TRUE );

			if( face_x >= ( x - EncAreObjSize[anm][0]/2 ) && face_x < ( x + EncAreObjSize[anm][0]/2 ) &&
				face_y >= ( y - EncAreObjSize[anm][1]/2 ) && face_y < ( y + EncAreObjSize[anm][1]/2 ) ){
				face_mv = TRUE;
			}
			// 出口にもＯＢＪセット
			EncExitObjPut( wk, exit_flg, ZKN2_OBJ_ENC_POS+1 );
			if( face_mv == FALSE && exit_flg != 0 ){
				face_mv = EncExitFaceCheck( wk, ZKN2_OBJ_ENC_POS+1, face_x, face_y );
			}
		}
	}

	// 顔ＯＢＪアニメ切り替え
	ZKN2OBJ_EncFaceAnmChange( wk, face_mv );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページ 分布位置ＯＢＪ全非表示
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_PlacePosAllOff( ZKN2_WORK * wk )
{
	u32	i;

	for( i=ZKN2_OBJ_ENC_POS; i<ZKN2_OBJ_ENC_MAX; i++ ){
		ZKN2OBJ_Vanish( wk, i, FALSE );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページ 分布位置ＯＢＪ表示切替（点滅時）
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_PlacePosOnOffChange( ZKN2_WORK * wk )
{
	u32	exit_on;
	u32	exit_off;
	u32	flg;
	u16	i;

	exit_on  = 0;
	exit_off = 0;

	if( wk->detail_place_pos == 0 ){
		for( i=1; i<wk->enc_data.all.num; i++ ){
			if( ZKN2MAIN_EncTypeCheck( wk, i, wk->detail_place_put_flg ) != 0 ){
				CATS_ObjectPaletteSetCap( wk->cap[ZKN2_OBJ_ENC_POS+i-1], 4+wk->detail_place_put_flg );
				ZKN2OBJ_Vanish( wk, ZKN2_OBJ_ENC_POS+i-1, TRUE );
			}else{
				ZKN2OBJ_Vanish( wk, ZKN2_OBJ_ENC_POS+i-1, FALSE );
				if( ZKN2MAIN_EncPosTypeGet( wk, i ) != 0 ){
					EncExitPosCheck( ZKN2MAIN_DanZoneIDGet(wk->enc_data.all.map[i]), &exit_off );
				}
			}
			if( ZKN2MAIN_EncPosTypeGet( wk, i ) != 0 ){
				EncExitPosCheck( ZKN2MAIN_DanZoneIDGet(wk->enc_data.all.map[i]), &exit_on );
			}
		}
		EncExitObjVanish( wk, exit_on, exit_off, ZKN2_OBJ_ENC_POS+i-1, 4+wk->detail_place_put_flg );
	}else{
		ZKN2OBJ_PlacePosAllOff( wk );
		if( ZKN2MAIN_EncTypeCheck( wk, wk->detail_place_pos, wk->detail_place_put_flg ) != 0 ){
			CATS_ObjectPaletteSetCap( wk->cap[ZKN2_OBJ_ENC_POS], 4+wk->detail_place_put_flg );
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_ENC_POS, TRUE );
		}else{
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_ENC_POS, FALSE );
			if( ZKN2MAIN_EncPosTypeGet( wk, wk->detail_place_pos ) != 0 ){
				EncExitPosCheck( ZKN2MAIN_DanZoneIDGet(wk->enc_data.all.map[wk->detail_place_pos]), &exit_off );
			}
		}
		if( ZKN2MAIN_EncPosTypeGet( wk, wk->detail_place_pos ) != 0 ){
			EncExitPosCheck( ZKN2MAIN_DanZoneIDGet(wk->enc_data.all.map[wk->detail_place_pos]), &exit_on );
		}
		EncExitObjVanish( wk, exit_on, exit_off, ZKN2_OBJ_ENC_POS+1, 4+wk->detail_place_put_flg );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページ 分布位置出口チェック
 *
 * @param	map		ゾーンＩＤ
 * @param	flg		チェック結果保存場所
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void EncExitPosCheck( u32 map, u32 * flg )
{
	if( map == ZONE_ID_D01R0101 ){
		*flg |= 1;
		return;
	}
	if( map == ZONE_ID_D39R0101 ||
		map == ZONE_ID_D39R0102 ||
		map == ZONE_ID_D39R0103 ||
		map == ZONE_ID_D39R0104 ){
		*flg |= 2;
		return;
	}
	if( map == ZONE_ID_D42R0101 ||
		map == ZONE_ID_D42R0102 ){
		*flg |= 4;
		return;
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページ 分布位置出口ＯＢＪ配置
 *
 * @param	wk		図鑑画面ワーク
 * @param	flg		配置フラグ
 * @param	objID	出口ＯＢＪ開始番号
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void EncExitObjPut( ZKN2_WORK * wk, u32 flg, u32 objID )
{
	if( flg & 1 ){
		ObjPosSet( wk, objID, (32-22)*8+FACE_ICON_PX, 4*8+FACE_ICON_PY, NNS_G2D_VRAM_TYPE_2DSUB );
		ZKN2OBJ_AnmSet( wk, objID, PLACE_POS_ANM_1x1 );
		ZKN2OBJ_Vanish( wk, objID, TRUE );
		objID++;
	}
	if( flg & 2 ){
		ObjPosSet( wk, objID, 21*8+FACE_ICON_PX, 4*8+FACE_ICON_PY, NNS_G2D_VRAM_TYPE_2DSUB );
		ZKN2OBJ_AnmSet( wk, objID, PLACE_POS_ANM_1x1 );
		ZKN2OBJ_Vanish( wk, objID, TRUE );
		objID++;
	}
	if( flg & 4 ){
		ObjPosSet( wk, objID, 20*8+FACE_ICON_PX, 6*8+FACE_ICON_PY, NNS_G2D_VRAM_TYPE_2DSUB );
		ZKN2OBJ_AnmSet( wk, objID, PLACE_POS_ANM_1x1 );
		ZKN2OBJ_Vanish( wk, objID, TRUE );
		objID++;

		ObjPosSet( wk, objID, 19*8+FACE_ICON_PX, 10*8+FACE_ICON_PY, NNS_G2D_VRAM_TYPE_2DSUB );
		ZKN2OBJ_AnmSet( wk, objID, PLACE_POS_ANM_1x1 );
		ZKN2OBJ_Vanish( wk, objID, TRUE );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページ 分布位置出口ＯＢＪ表示切替
 *
 * @param	wk		図鑑画面ワーク
 * @param	on		表示するかどうかの大元
 * @param	off		表示フラグ
 * @param	objID	出口ＯＢＪ開始番号
 * @param	pal		使用パレット
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void EncExitObjVanish( ZKN2_WORK * wk, u32 on, u32 off, u32 objID, u32 pal )
{
	if( on & 1 ){
		if( off & 1 ){
			ZKN2OBJ_Vanish( wk, objID, FALSE );
		}else{
			ZKN2OBJ_Vanish( wk, objID, TRUE );
			CATS_ObjectPaletteSetCap( wk->cap[objID], pal );
		}
		objID++;
	}
	if( on & 2 ){
		if( off & 2 ){
			ZKN2OBJ_Vanish( wk, objID, FALSE );
		}else{
			ZKN2OBJ_Vanish( wk, objID, TRUE );
			CATS_ObjectPaletteSetCap( wk->cap[objID], pal );
		}
		objID++;
	}
	if( on & 4 ){
		if( off & 4 ){
			ZKN2OBJ_Vanish( wk, objID, FALSE );
			ZKN2OBJ_Vanish( wk, objID+1, FALSE );
		}else{
			ZKN2OBJ_Vanish( wk, objID, TRUE );
			ZKN2OBJ_Vanish( wk, objID+1, TRUE );
			CATS_ObjectPaletteSetCap( wk->cap[objID], pal );
			CATS_ObjectPaletteSetCap( wk->cap[objID+1], pal );
		}
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページ 分布位置出口ＯＢＪ表示位置に顔ＯＢＪがあるか
 *
 * @param	wk		図鑑画面ワーク
 * @param	start	出口ＯＢＪ開始番号
 * @param	face_x	顔表示Ｘ座標
 * @param	face_y	顔表示Ｙ座標
 *
 * @retval	"TRUE = あり"
 * @retval	"FALSE = なし"
 */
//--------------------------------------------------------------------------------------------
static BOOL EncExitFaceCheck( ZKN2_WORK * wk, u32 start, s16 face_x, s16 face_y )
{
	const u8 * siz;
	u32	i;
	s16	x, y;

	siz = EncAreObjSize[PLACE_POS_ANM_1x1];

	for( i=start; i<start+4; i++ ){
		if( CATS_ObjectEnableGetCap( wk->cap[i] ) == ACT_OFF ){ continue; }
		ObjPosGet( wk, i, &x, &y, NNS_G2D_VRAM_TYPE_2DSUB );
		if( face_x >= ( x - siz[0]/2 ) && face_x < ( x + siz[0]/2 ) &&
			face_y >= ( y - siz[1]/2 ) && face_y < ( y + siz[1]/2 ) ){
			return TRUE;
		}
	}
	return FALSE;
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面大きさページＯＢＪ初期化
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SizePageInit( ZKN2_WORK * wk )
{
	u32	i;

	SizePageResLoad( wk );

	for( i=ZKN2_OBJ_SIZE_SILHOUETTE; i<ZKN2_OBJ_SIZE_MAX; i++ ){
		wk->cap[i] = ObjAdd( wk, &ClaSizePagePrm[i-ZKN2_OBJ_SIZE_SILHOUETTE] );
	}

	SizePokeIconChange( wk );
	SizePokeGraChange( wk );
	SizeMyGraSet( wk );

	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SIZE_POKEICON_S, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_SIZE_MYICON_S, FALSE );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面大きさページＯＢＪ削除
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_SizePageDelete( ZKN2_WORK * wk )
{
	u32	i;

	for( i=ZKN2_OBJ_SIZE_SILHOUETTE; i<ZKN2_OBJ_SIZE_MAX; i++ ){
		ClactDel( wk, i );
	}

	SizePageResFree( wk );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面大きさページ リソース読み込み
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SizePageResLoad( ZKN2_WORK * wk )
{
	// ポケアイコン（メイン）
	PokeIconResLoad( wk, 1 );

	// ポケアイコン（サブ）
	CATS_LoadResourceCharArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_pokeicon_dmy_lz_NCGR,
		1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_POKEICON+1 );
	CATS_LoadResourcePlttWorkArcH(
		wk->pfd, FADE_SUB_OBJ,
		wk->csp, wk->crp,
		wk->pokeicon_ah, PokeIconPalArcIndexGet(), 0,
		PALSIZ_POKEICON, NNS_G2D_VRAM_TYPE_2DSUB, PAL_ID_POKEICON_S );

	// 主人公アイコン
	CATS_LoadResourceCellArcH(
		wk->csp, wk->crp,
		wk->graphic_ah, NARC_zukan_gra_hero_lz_NCER, 1, CEL_ID_MYICON );
	CATS_LoadResourceCellAnmArcH(
		wk->csp, wk->crp,
		wk->graphic_ah, NARC_zukan_gra_hero_lz_NANR, 1, ANM_ID_MYICON );
	// シルエット
	CATS_LoadResourceCellArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_hero_silhouette_lz_NCER, 1, CEL_ID_MYSILHOUETTE );
	CATS_LoadResourceCellAnmArcH(
		wk->csp, wk->crp, wk->graphic_ah,
		NARC_zukan_gra_hero_silhouette_lz_NANR, 1, ANM_ID_MYSILHOUETTE );

	if( MyStatus_GetMySex( wk->dat->myst ) == 0 ){
		CATS_LoadResourceCharArcH(
			wk->csp, wk->crp, wk->graphic_ah,
			NARC_zukan_gra_hero_lz_NCGR, 1, NNS_G2D_VRAM_TYPE_2DMAIN, CHR_ID_MYICON_M );
		CATS_LoadResourceCharArcH(
			wk->csp, wk->crp, wk->graphic_ah,
			NARC_zukan_gra_hero_lz_NCGR, 1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_MYICON_S );
		CATS_LoadResourceCharArcH(
			wk->csp, wk->crp, wk->graphic_ah,
			NARC_zukan_gra_hero_silhouette_lz_NCGR, 1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_MYSILHOUETTE );
		CATS_LoadResourcePlttWorkArcH(
			wk->pfd, FADE_MAIN_OBJ,
			wk->csp, wk->crp,
			wk->graphic_ah, NARC_zukan_gra_hero_NCLR,
			0, PALSIZ_MYICON, NNS_G2D_VRAM_TYPE_2DMAIN, PAL_ID_MYICON_M );
		CATS_LoadResourcePlttWorkArcH(
			wk->pfd, FADE_SUB_OBJ,
			wk->csp, wk->crp,
			wk->graphic_ah, NARC_zukan_gra_hero_NCLR,
			0, PALSIZ_MYICON, NNS_G2D_VRAM_TYPE_2DSUB, PAL_ID_MYICON_S );
	}else{
		CATS_LoadResourceCharArcH(
			wk->csp, wk->crp, wk->graphic_ah,
			NARC_zukan_gra_heroine_lz_NCGR, 1, NNS_G2D_VRAM_TYPE_2DMAIN, CHR_ID_MYICON_M );
		CATS_LoadResourceCharArcH(
			wk->csp, wk->crp, wk->graphic_ah,
			NARC_zukan_gra_heroine_lz_NCGR, 1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_MYICON_S );
		CATS_LoadResourceCharArcH(
			wk->csp, wk->crp, wk->graphic_ah,
			NARC_zukan_gra_heroine_silhouette_lz_NCGR, 1, NNS_G2D_VRAM_TYPE_2DSUB, CHR_ID_MYSILHOUETTE );
		CATS_LoadResourcePlttWorkArcH(
			wk->pfd, FADE_MAIN_OBJ,
			wk->csp, wk->crp,
			wk->graphic_ah, NARC_zukan_gra_heroine_NCLR,
			0, PALSIZ_MYICON, NNS_G2D_VRAM_TYPE_2DMAIN, PAL_ID_MYICON_M );
		CATS_LoadResourcePlttWorkArcH(
			wk->pfd, FADE_SUB_OBJ,
			wk->csp, wk->crp,
			wk->graphic_ah, NARC_zukan_gra_heroine_NCLR,
			0, PALSIZ_MYICON, NNS_G2D_VRAM_TYPE_2DSUB, PAL_ID_MYICON_S );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面大きさページ リソース削除
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SizePageResFree( ZKN2_WORK * wk )
{
	PokeIconResFree( wk, 1 );

	CATS_FreeResourceChar( wk->crp, CHR_ID_POKEICON+1 );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_POKEICON_S );

	CATS_FreeResourceCell( wk->crp, CEL_ID_MYICON );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_MYICON );

	CATS_FreeResourceCell( wk->crp, CEL_ID_MYSILHOUETTE );
	CATS_FreeResourceCellAnm( wk->crp, ANM_ID_MYSILHOUETTE );

	CATS_FreeResourceChar( wk->crp, CHR_ID_MYICON_M );
	CATS_FreeResourceChar( wk->crp, CHR_ID_MYICON_S );
	CATS_FreeResourceChar( wk->crp, CHR_ID_MYSILHOUETTE );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_MYICON_M );
	CATS_FreeResourcePltt( wk->crp, PAL_ID_MYICON_S );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面大きさページ ポケモンアイコン切り替え
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SizePokeIconChange( ZKN2_WORK * wk )
{
	u8	frm;

	if( wk->detail_form[0] & ZKN2MAIN_FORM_EXTRA ){
		frm = wk->detail_form[0] ^ ZKN2MAIN_FORM_EXTRA;
		if( wk->detail_mons == MONSNO_PITYUU ){
			if( frm == 2 ){
				frm = 1;
			}else{
				frm = 0;
			}
		}
	}else{
		frm = 0;
	}

	// メイン
	PokeIconChange( wk, wk->detail_mons, frm, ZKN2_OBJ_SIZE_POKEICON_M );

	// サブ
	PokeIconChangeSub( wk, wk->detail_mons, frm, ZKN2_OBJ_SIZE_POKEICON_S );

	CATS_ObjectAffineSetCap( wk->cap[ZKN2_OBJ_SIZE_BOARD], CLACT_AFFINE_DOUBLE );
	CATS_ObjectRotationSetCap( wk->cap[ZKN2_OBJ_SIZE_BOARD], 0 );
	CATS_ObjectAffinePosSetCap( wk->cap[ZKN2_OBJ_SIZE_BOARD], 0, -4 );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面大きさページ ポケグラ切り替え
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SizePokeGraChange( ZKN2_WORK * wk )
{
	ZKN2_SIZE_WORK * siz;
//	f32	scale;
	u8	frm, sex;

	FormSexGet( wk, 0, &frm, &sex );

	siz = &wk->size_work;

	PokeGraBgSet( wk, wk->detail_mons, frm, sex, PARA_FRONT );
	PokeGraBgScroll( wk, siz->pokePos[wk->detail_mons], siz->pokeScale[wk->detail_mons] );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面大きさページ 主人公の絵をセット
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void SizeMyGraSet( ZKN2_WORK * wk )
{
	ZKN2_SIZE_WORK * siz;
	s16	x, y;
	f32	scale;

	siz = &wk->size_work;

	scale = FX_FX32_TO_F32( HEIGHT_SCALE(siz->myScale[wk->detail_mons]) );

	CATS_ObjectAffineSetCap( wk->cap[ZKN2_OBJ_SIZE_SILHOUETTE], CLACT_AFFINE_DOUBLE );
	CATS_ObjectScaleSetCap( wk->cap[ZKN2_OBJ_SIZE_SILHOUETTE], scale, scale );

	ObjPosGet( wk, ZKN2_OBJ_SIZE_SILHOUETTE, &x, &y, NNS_G2D_VRAM_TYPE_2DSUB );
	ObjPosSet( wk, ZKN2_OBJ_SIZE_SILHOUETTE, x, y+siz->myPos[wk->detail_mons], NNS_G2D_VRAM_TYPE_2DSUB );
}


//============================================================================================
//	重さ比べ演出
//============================================================================================

//--------------------------------------------------------------------------------------------
/**
 * 回転座標作成
 *
 * @param	rot		角度
 * @param	x		Ｘ座標
 * @param	y		Ｙ座標
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void RotatePosMake( u16 rot, s16 * x, s16 * y )
{
	fx32	sin, cos;

	sin = FX32_CONST( FX_FX16_TO_F32(FX_SinIdx(rot)) );
	cos = FX32_CONST( FX_FX16_TO_F32(FX_CosIdx(rot)) );

	*x = *x + ( ( sin * HANKEI ) >> FX32_SHIFT );
	*y = *y + ( ( cos * HANKEI ) >> FX32_SHIFT );

//	OS_Printf( "rot = 0x%x, sin = %d, cos = %d, x = 0x%x, y = 0x%x\n", rot, sin, cos, *x, *y );
}

//--------------------------------------------------------------------------------------------
/**
 * 皿回転移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	id		OBJ ID
 * @param	rot		角度
 * @param	px		Ｘ座標
 * @param	py		Ｙ座標
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void RotateDishMove( ZKN2_WORK * wk, u32 id, u16 rot, s16 px, s16 py )
{
	RotatePosMake( rot, &px, &py );
	ObjPosSet( wk, id, px, py, NNS_G2D_VRAM_TYPE_2DMAIN );
}

//--------------------------------------------------------------------------------------------
/**
 * ポケモン/主人公アイコン回転移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	c		皿OBJのID
 * @param	p		アイコンOBJのID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void RotateIconMove( ZKN2_WORK * wk, u32 c, u32 p )
{
	s16	x, y;

	ObjPosGet( wk, p, &x, &y, NNS_G2D_VRAM_TYPE_2DMAIN );
	y += WEIGHT_ANM_ICON_PY;
	ObjPosSet( wk, c, x, y, NNS_G2D_VRAM_TYPE_2DMAIN );
}

//--------------------------------------------------------------------------------------------
/**
 * 皿/アイコン回転移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	rot		角度
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void RotateMove( ZKN2_WORK * wk, u16 rot )
{
	RotateDishMove(
		wk, ZKN2_OBJ_SIZE_DISH_L, -rot-DEFAULT_ROT_PARAM, SIZE_ROT_DISH_CX, SIZE_ROT_DISH_CY );
	RotateDishMove(
		wk, ZKN2_OBJ_SIZE_DISH_R, -rot+DEFAULT_ROT_PARAM, SIZE_ROT_DISH_CX, SIZE_ROT_DISH_CY );
	RotateIconMove( wk, ZKN2_OBJ_SIZE_POKEICON_M, ZKN2_OBJ_SIZE_DISH_L );
	RotateIconMove( wk, ZKN2_OBJ_SIZE_MYICON_M, ZKN2_OBJ_SIZE_DISH_R );
}

//--------------------------------------------------------------------------------------------
/**
 * 大きさ比べアニメワーク初期化
 *
 * @param	syswk	図鑑画面ワーク
 * @param	anmwk	アニメワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_WeightAnmWorkInit( ZKN2_WORK * syswk, ZKN2OBJ_WEIGHT_ANM_WORK * anmwk )
{
	u32	h, l;
	u32	i;

	anmwk->sys        = syswk;
	anmwk->fall_speed = 0;
	anmwk->main_seq   = 0;

#if 1
	if( MyStatus_GetMySex( syswk->dat->myst ) == 0 ){
		h = WEIGHT_HERO;
	}else{
		h = WEIGHT_HEROINE;
	}

	if( syswk->mons_weight[syswk->detail_mons] >= h ){
		l = h;
		h = syswk->mons_weight[syswk->detail_mons];
		anmwk->mv = 0;
	}else{
		l = syswk->mons_weight[syswk->detail_mons];
		anmwk->mv= 1;
	}

	h = ( h - l ) / 10;

	for( i=0; i<NELEMS(WeightAnmPatTbl); i++ ){
		if( h >= WeightAnmPatTbl[i].low && h <= WeightAnmPatTbl[i].hi ){
			anmwk->anm = i;
			break;
		}
	}
#else
	// デバッグ
	anmwk->mv  = 0;
	anmwk->anm = syswk->detail_mons % 17;
#endif

}

//--------------------------------------------------------------------------------------------
/**
 * 大きさ比べ演出：アイコン下降アニメ
 *
 * @param	wk	アニメワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
BOOL ZKN2OBJ_WeightAnmFall( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	s16	x1, y1;
	s16	x2, y2;

	ObjPosGet( wk->sys, ZKN2_OBJ_SIZE_POKEICON_M, &x1, &y1, NNS_G2D_VRAM_TYPE_2DMAIN );
	ObjPosGet( wk->sys, ZKN2_OBJ_SIZE_MYICON_M, &x2, &y2, NNS_G2D_VRAM_TYPE_2DMAIN );

	wk->fall_speed += WEIGHT_ANM_FALL_SPEED;

	y1 += ( wk->fall_speed >> FX32_SHIFT );
	y2 += ( wk->fall_speed >> FX32_SHIFT );

	if( y1 >= WEIGHT_ANM_FALL_END_PY ){
		ObjPosSet( wk->sys, ZKN2_OBJ_SIZE_POKEICON_M, x1, WEIGHT_ANM_FALL_END_PY, NNS_G2D_VRAM_TYPE_2DMAIN );
		ObjPosSet( wk->sys, ZKN2_OBJ_SIZE_MYICON_M, x2, WEIGHT_ANM_FALL_END_PY, NNS_G2D_VRAM_TYPE_2DMAIN );
		return FALSE;
	}
	ObjPosSet( wk->sys, ZKN2_OBJ_SIZE_POKEICON_M, x1, y1, NNS_G2D_VRAM_TYPE_2DMAIN );
	ObjPosSet( wk->sys, ZKN2_OBJ_SIZE_MYICON_M, x2, y2, NNS_G2D_VRAM_TYPE_2DMAIN );

	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * 大きさ比べ演出：比較アニメメイン
 *
 * @param	wk	アニメワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
BOOL ZKN2OBJ_WeightAnmMain( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	return WeightAnmFuncTbl[wk->anm]( wk );
}

//--------------------------------------------------------------------------------------------
/**
 * 回転アニメパラメータ設定
 *
 * @param	wk		アニメワーク
 * @param	mv		角度移動値
 * @param	spd		角度移動速度
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void WeightAnmRotParamSet( ZKN2OBJ_WEIGHT_ANM_WORK * wk, s32 mv, s32 spd )
{
	if( wk->mv == 0 ){
		wk->rot_mv  = -mv;
		wk->rot_spd = spd;
	}else{
		wk->rot_mv  = mv;
		wk->rot_spd = -spd;
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 回転アニメパラメータ設定
 *
 * @param	wk		アニメワーク
 * @param	mv		角度移動値
 * @param	spd		角度移動速度
 * @param	max		最大角度移動値
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void WeightAnmRotParamSet2( ZKN2OBJ_WEIGHT_ANM_WORK * wk, s32 mv, s32 spd, s32 max )
{
	if( wk->mv == 0 ){
 		wk->rot_mv  = -mv;
		wk->rot_spd = -spd;
		wk->rot_max = -max;
	}else{
		wk->rot_mv  = mv;
		wk->rot_spd = spd;
		wk->rot_max = max;
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ０
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc00( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	Snd_SePlay( SE_ZKN2_SIZE0 );
	return FALSE;
}

//--------------------------------------------------------------------------------------------
// 角度移動テーブル
// 最終的には未使用...
static const s32 WeightRotMoveTbl01[] = {
	0x100, 0xc0, 0x80, 0x40, 0, -0x40, -0x80, -0xc0
};
static const s32 WeightRotMoveTbl02[] = {
//	0x140, 0x100, 0xc0, 0x80, 0x40, 0, -0x40, -0x80, -0xc0, -0x100
	0x100, 0xe0, 0xc0, 0xa0, 0x80, 0x60, 0x40, 0x20, 0, -0x20, -0x40, -0x60, -0x80, -0xc0
};
static const s32 WeightRotMoveTbl03[] = {
//	0x180, 0x140, 0x100, 0xc0, 0x80, 0x40, 0, -0x40, -0x80, -0xc0, -0x100, -0x140
	0x180, 0x140, 0x100, 0xc0, 0x80, 0x40, 0, -0x40, -0x80, -0xc0, -0x100,
};
static const s32 WeightRotMoveTbl04[] = {
//	0x1c0, 0x180, 0x140, 0x100, 0xc0, 0x80, 0x40, 0, -0x40, -0x80, -0xc0, -0x100, -0x140, -0x180
	0x1c0, 0x180, 0x140, 0x100, 0xc0, 0x80, 0x40, 0, -0x40, -0x80, -0xc0,
};
static const s32 WeightRotMoveTbl05[] = {
	0x200, 0x1c0, 0x180, 0x140, 0x100, 0xc0, 0x80, 0x40, 0, -0x40, -0x80, -0xc0, -0x100, -0x140, -0x1c0
};
static const s32 WeightRotMoveTbl06[] = {
	0x200, 0x1e0, 0x1c0, 0x1a0, 0x180, 0x160, 0x140, 0x100, 0xc0, 0x80, 0x40, 0, -0x40, -0x80, -0xc0, -0x100, -0x140, -0x1c0, -0x200
};
static const s32 WeightRotMoveTbl07[] = {
	0x280, 0x240, 0x200, 0x1c0, 0x180, 0x140, 0x100, 0xc0, 0x80, 0x40, 0, -0x40, -0x80, -0xc0, -0x100, -0x140, -0x1c0, -0x240
};
//--------------------------------------------------------------------------------------------


//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ１
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc01( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	u16	rot;

	switch( wk->main_seq ){
	case 0:
		Snd_SePlay( SE_ZKN2_SIZE0 );
		WeightAnmRotParamSet2( wk, 0x100, -0x20, -0xe0 );
		wk->main_seq++;

	case 1:
		CATS_ObjectRotationAddCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], wk->rot_mv );
		rot = CATS_ObjectRotationGetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD] );
		RotateMove( wk->sys, rot );
		wk->rot_mv += wk->rot_spd;
		if( wk->rot_mv == wk->rot_max ){
			return FALSE;
		}
	}

	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ２
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc02( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	u16	rot;

	switch( wk->main_seq ){
	case 0:
		Snd_SePlay( SE_ZKN2_SIZE0 );
		WeightAnmRotParamSet2( wk, 0x120, -0x20, -0x100 );
		wk->main_seq++;

	case 1:
		CATS_ObjectRotationAddCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], wk->rot_mv );
		rot = CATS_ObjectRotationGetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD] );
		RotateMove( wk->sys, rot );
		wk->rot_mv += wk->rot_spd;
		if( wk->rot_mv == wk->rot_max ){
			return FALSE;
		}
	}

	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ３
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc03( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	u16	rot;

	switch( wk->main_seq ){
	case 0:
		Snd_SePlay( SE_ZKN2_SIZE0 );
		WeightAnmRotParamSet2( wk, 0x140, -0x20, -0x120 );
		wk->main_seq++;

	case 1:
		CATS_ObjectRotationAddCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], wk->rot_mv );
		rot = CATS_ObjectRotationGetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD] );
		RotateMove( wk->sys, rot );
		wk->rot_mv += wk->rot_spd;
		if( wk->rot_mv == wk->rot_max ){
			return FALSE;
		}
	}

	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ４
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc04( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	u16	rot;

	switch( wk->main_seq ){
	case 0:
		Snd_SePlay( SE_ZKN2_SIZE0 );
		WeightAnmRotParamSet2( wk, 0x160, -0x20, -0x140 );
		wk->main_seq++;

	case 1:
		CATS_ObjectRotationAddCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], wk->rot_mv );
		rot = CATS_ObjectRotationGetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD] );
		RotateMove( wk->sys, rot );
		wk->rot_mv += wk->rot_spd;
		if( wk->rot_mv == wk->rot_max ){
			return FALSE;
		}
	}

	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ５
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc05( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	u16	rot;

	switch( wk->main_seq ){
	case 0:
		Snd_SePlay( SE_ZKN2_SIZE0 );
		WeightAnmRotParamSet2( wk, 0x180, -0x20, -0x160 );
		wk->main_seq++;

	case 1:
		CATS_ObjectRotationAddCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], wk->rot_mv );
		rot = CATS_ObjectRotationGetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD] );
		RotateMove( wk->sys, rot );
		wk->rot_mv += wk->rot_spd;
		if( wk->rot_mv == wk->rot_max ){
			return FALSE;
		}
	}

	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ６
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc06( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	u16	rot;

	switch( wk->main_seq ){
	case 0:
		Snd_SePlay( SE_ZKN2_SIZE0 );
		WeightAnmRotParamSet2( wk, 0x1c0, -0x40, -0x140 );
//		WeightAnmRotParamSet2( wk, 0x1a0, -0x20, -0x180 );
		wk->main_seq++;

	case 1:
		CATS_ObjectRotationAddCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], wk->rot_mv );
		rot = CATS_ObjectRotationGetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD] );
		RotateMove( wk->sys, rot );
		wk->rot_mv += wk->rot_spd;
		if( wk->rot_mv == wk->rot_max ){
			return FALSE;
		}
	}

	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ７
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc07( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	u16	rot;

	switch( wk->main_seq ){
	case 0:
		Snd_SePlay( SE_ZKN2_SIZE0 );
		WeightAnmRotParamSet2( wk, 0x200, -0x40, -0x180 );
//		WeightAnmRotParamSet2( wk, 0x1c0, -0x20, -0x1a0 );
		wk->main_seq++;

	case 1:
		CATS_ObjectRotationAddCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], wk->rot_mv );
		rot = CATS_ObjectRotationGetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD] );
		RotateMove( wk->sys, rot );
		wk->rot_mv += wk->rot_spd;
		if( wk->rot_mv == wk->rot_max ){
			return FALSE;
		}
	}

	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * ジャンプパラメータ設定
 *
 * @param	wk		アニメワーク
 * @param	mv		移動値
 * @param	spd		速度
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void WeightAnmJumpParamSet( ZKN2OBJ_WEIGHT_ANM_WORK * wk, s16 mv, s16 spd )
{
	s16	x1, y1;
	s16	x2, y2;

	wk->jump_mv  = mv;
	wk->jump_spd = spd;

	ObjPosGet( wk->sys, ZKN2_OBJ_SIZE_POKEICON_M, &x1, &y1, NNS_G2D_VRAM_TYPE_2DMAIN );
	ObjPosGet( wk->sys, ZKN2_OBJ_SIZE_MYICON_M, &x2, &y2, NNS_G2D_VRAM_TYPE_2DMAIN );
	if( y1 < y2 ){
		wk->jump_obj_c = ZKN2_OBJ_SIZE_POKEICON_M;
		wk->jump_obj_p = ZKN2_OBJ_SIZE_DISH_L;
		ZKN2OBJ_Vanish( wk->sys, ZKN2_OBJ_SIZE_POKEICON_S, TRUE );
		ObjPosSet( wk->sys, ZKN2_OBJ_SIZE_POKEICON_S, x1, y1+192, NNS_G2D_VRAM_TYPE_2DSUB );
	}else{
		wk->jump_obj_c = ZKN2_OBJ_SIZE_MYICON_M;
		wk->jump_obj_p = ZKN2_OBJ_SIZE_DISH_R;
		ZKN2OBJ_Vanish( wk->sys, ZKN2_OBJ_SIZE_MYICON_S, TRUE );
		ObjPosSet( wk->sys, ZKN2_OBJ_SIZE_MYICON_S, x2, y2+192, NNS_G2D_VRAM_TYPE_2DSUB );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * ジャンプアニメメイン
 *
 * @param	wk		アニメワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void WeightAnmJumpMain( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	s16	x1, y1;

	ObjPosGet( wk->sys, wk->jump_obj_c, &x1, &y1, NNS_G2D_VRAM_TYPE_2DMAIN );
	y1 += wk->jump_mv;
	ObjPosSet( wk->sys, wk->jump_obj_c, x1, y1, NNS_G2D_VRAM_TYPE_2DMAIN );

	ObjPosGet( wk->sys, wk->jump_obj_c+1, &x1, &y1, NNS_G2D_VRAM_TYPE_2DSUB );
	y1 += wk->jump_mv;
	ObjPosSet( wk->sys, wk->jump_obj_c+1, x1, y1, NNS_G2D_VRAM_TYPE_2DSUB );

	wk->jump_mv += wk->jump_spd;
}

//--------------------------------------------------------------------------------------------
/**
 * ジャンプアニメ
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmJumpCheck( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	s16	x1, y1;
	s16	x2, y2;

	WeightAnmJumpMain( wk );

	ObjPosGet( wk->sys, wk->jump_obj_c, &x1, &y1, NNS_G2D_VRAM_TYPE_2DMAIN );
	ObjPosGet( wk->sys, wk->jump_obj_p, &x2, &y2, NNS_G2D_VRAM_TYPE_2DMAIN );

	if( y1 >= ( y2 + WEIGHT_ANM_ICON_PY ) ){
		ObjPosSet( wk->sys, wk->jump_obj_c, x2, y2+WEIGHT_ANM_ICON_PY, NNS_G2D_VRAM_TYPE_2DMAIN );
		return FALSE;
	}
	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ８
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc08( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	u16	rot;

	switch( wk->main_seq ){
	case 0:
		Snd_SePlay( SE_ZKN2_SIZE0 );
		WeightAnmRotParamSet( wk, 0x300, 0 );
		wk->main_seq++;

	case 1:
		CATS_ObjectRotationAddCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], wk->rot_mv );
		rot = CATS_ObjectRotationGetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD] );
		RotateMove( wk->sys, rot );
		wk->rot_mv += wk->rot_spd;
		if( wk->mv == 0 ){
			if( rot <= WEIGHT_ROT_MIN ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MIN );
				RotateMove( wk->sys, WEIGHT_ROT_MIN );
				return FALSE;
			}
		}else{
			if( rot >= WEIGHT_ROT_MAX ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MAX );
				RotateMove( wk->sys, WEIGHT_ROT_MAX );
				return FALSE;
			}
		}
	}

	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ９
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc09( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	u16	rot;

	switch( wk->main_seq ){
	case 0:
		Snd_SePlay( SE_ZKN2_SIZE1 );
		WeightAnmRotParamSet( wk, 0x300, 0 );
		wk->main_seq++;

	case 1:
		CATS_ObjectRotationAddCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], wk->rot_mv );
		rot = CATS_ObjectRotationGetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD] );
		RotateMove( wk->sys, rot );
		wk->rot_mv += wk->rot_spd;
		if( wk->mv == 0 ){
			if( rot <= WEIGHT_ROT_MIN ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MIN );
				RotateMove( wk->sys, WEIGHT_ROT_MIN );
				wk->main_seq++;
			}else{
				break;
			}
		}else{
			if( rot >= WEIGHT_ROT_MAX ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MAX );
				RotateMove( wk->sys, WEIGHT_ROT_MAX );
				wk->main_seq++;
			}else{
				break;
			}
		}


	case 2:
		WeightAnmJumpParamSet( wk, -4, 1 );
		wk->main_seq++;

	case 3:
		if( WeightAnmJumpCheck( wk ) == FALSE ){
			return FALSE;
		}
	}

	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ１０
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc10( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	u16	rot;

	switch( wk->main_seq ){
	case 0:
		Snd_SePlay( SE_ZKN2_SIZE1 );
		WeightAnmRotParamSet( wk, 0x400, 0 );
		wk->main_seq++;

	case 1:
		CATS_ObjectRotationAddCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], wk->rot_mv );
		rot = CATS_ObjectRotationGetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD] );
		RotateMove( wk->sys, rot );
		wk->rot_mv += wk->rot_spd;
		if( wk->mv == 0 ){
			if( rot <= WEIGHT_ROT_MIN ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MIN );
				RotateMove( wk->sys, WEIGHT_ROT_MIN );
				wk->main_seq++;
			}else{
				break;
			}
		}else{
			if( rot >= WEIGHT_ROT_MAX ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MAX );
				RotateMove( wk->sys, WEIGHT_ROT_MAX );
				wk->main_seq++;
			}else{
				break;
			}
		}


	case 2:
		WeightAnmJumpParamSet( wk, -8, 1 );
		wk->main_seq++;

	case 3:
		if( WeightAnmJumpCheck( wk ) == FALSE ){
			return FALSE;
		}
	}

	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ１１
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc11( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	u16	rot;

	switch( wk->main_seq ){
	case 0:
		Snd_SePlay( SE_ZKN2_SIZE1 );
		WeightAnmRotParamSet( wk, 0x400, 0 );
		wk->main_seq++;

	case 1:
		CATS_ObjectRotationAddCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], wk->rot_mv );
		rot = CATS_ObjectRotationGetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD] );
		RotateMove( wk->sys, rot );
		wk->rot_mv += wk->rot_spd;
		if( wk->mv == 0 ){
			if( rot <= WEIGHT_ROT_MIN ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MIN );
				RotateMove( wk->sys, WEIGHT_ROT_MIN );
				wk->main_seq++;
			}else{
				break;
			}
		}else{
			if( rot >= WEIGHT_ROT_MAX ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MAX );
				RotateMove( wk->sys, WEIGHT_ROT_MAX );
				wk->main_seq++;
			}else{
				break;
			}
		}


	case 2:
		WeightAnmJumpParamSet( wk, -12, 1 );
		wk->main_seq++;

	case 3:
		if( WeightAnmJumpCheck( wk ) == FALSE ){
			return FALSE;
		}
	}

	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ１２
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc12( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	u16	rot;

	switch( wk->main_seq ){
	case 0:
		Snd_SePlay( SE_ZKN2_SIZE2 );
		WeightAnmRotParamSet( wk, 0x500, 0 );
		wk->main_seq++;

	case 1:
		CATS_ObjectRotationAddCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], wk->rot_mv );
		rot = CATS_ObjectRotationGetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD] );
		RotateMove( wk->sys, rot );
		wk->rot_mv += wk->rot_spd;
		if( wk->mv == 0 ){
			if( rot <= WEIGHT_ROT_MIN ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MIN );
				RotateMove( wk->sys, WEIGHT_ROT_MIN );
				wk->main_seq++;
			}else{
				break;
			}
		}else{
			if( rot >= WEIGHT_ROT_MAX ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MAX );
				RotateMove( wk->sys, WEIGHT_ROT_MAX );
				wk->main_seq++;
			}else{
				break;
			}
		}

	case 2:
		WeightAnmJumpParamSet( wk, -14, 1 );
		wk->main_seq++;

	case 3:
		if( WeightAnmJumpCheck( wk ) == FALSE ){
			return FALSE;
		}
	}

	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ１３
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc13( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	u16	rot;

	switch( wk->main_seq ){
	case 0:
		Snd_SePlay( SE_ZKN2_SIZE2 );
		WeightAnmRotParamSet( wk, 0x500, 0 );
		wk->main_seq++;

	case 1:
		CATS_ObjectRotationAddCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], wk->rot_mv );
		rot = CATS_ObjectRotationGetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD] );
		RotateMove( wk->sys, rot );
		wk->rot_mv += wk->rot_spd;
		if( wk->mv == 0 ){
			if( rot <= WEIGHT_ROT_MIN ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MIN );
				RotateMove( wk->sys, WEIGHT_ROT_MIN );
				wk->main_seq++;
			}else{
				break;
			}
		}else{
			if( rot >= WEIGHT_ROT_MAX ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MAX );
				RotateMove( wk->sys, WEIGHT_ROT_MAX );
				wk->main_seq++;
			}else{
				break;
			}
		}

	case 2:
		WeightAnmJumpParamSet( wk, -18, 1 );
		wk->main_seq++;

	case 3:
		if( WeightAnmJumpCheck( wk ) == FALSE ){
			return FALSE;
		}
	}

	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ１４
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc14( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	u16	rot;

	switch( wk->main_seq ){
	case 0:
		Snd_SePlay( SE_ZKN2_SIZE2 );
		WeightAnmRotParamSet( wk, 0x600, 0 );
		wk->main_seq++;

	case 1:
		CATS_ObjectRotationAddCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], wk->rot_mv );
		rot = CATS_ObjectRotationGetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD] );
		RotateMove( wk->sys, rot );
		wk->rot_mv += wk->rot_spd;
		if( wk->mv == 0 ){
			if( rot <= WEIGHT_ROT_MIN ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MIN );
				RotateMove( wk->sys, WEIGHT_ROT_MIN );
				wk->main_seq++;
			}else{
				break;
			}
		}else{
			if( rot >= WEIGHT_ROT_MAX ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MAX );
				RotateMove( wk->sys, WEIGHT_ROT_MAX );
				wk->main_seq++;
			}else{
				break;
			}
		}

	case 2:
		WeightAnmJumpParamSet( wk, -21, 1 );
		wk->main_seq++;

	case 3:
		if( WeightAnmJumpCheck( wk ) == FALSE ){
			return FALSE;
		}
	}

	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ１５
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc15( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	u16	rot;

	switch( wk->main_seq ){
	case 0:
		Snd_SePlay( SE_ZKN2_SIZE2 );
		WeightAnmRotParamSet( wk, 0x700, 0 );
		wk->main_seq++;

	case 1:
		CATS_ObjectRotationAddCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], wk->rot_mv );
		rot = CATS_ObjectRotationGetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD] );
		RotateMove( wk->sys, rot );
		wk->rot_mv += wk->rot_spd;
		if( wk->mv == 0 ){
			if( rot <= WEIGHT_ROT_MIN ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MIN );
				RotateMove( wk->sys, WEIGHT_ROT_MIN );
				wk->main_seq++;
			}else{
				break;
			}
		}else{
			if( rot >= WEIGHT_ROT_MAX ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MAX );
				RotateMove( wk->sys, WEIGHT_ROT_MAX );
				wk->main_seq++;
			}else{
				break;
			}
		}

	case 2:
		WeightAnmJumpParamSet( wk, -24, 1 );
		wk->main_seq++;

	case 3:
		if( WeightAnmJumpCheck( wk ) == FALSE ){
			return FALSE;
		}
	}

	return TRUE;
}

//--------------------------------------------------------------------------------------------
/**
 * 重さ比較アニメ１６
 *
 * @param	wk		アニメワーク
 *
 * @retval	"TRUE = 処理中"
 * @retval	"FALSE = 終了"
 */
//--------------------------------------------------------------------------------------------
static BOOL WeightAnmFunc16( ZKN2OBJ_WEIGHT_ANM_WORK * wk )
{
	u16	rot;

	switch( wk->main_seq ){
	case 0:
		Snd_SePlay( SE_ZKN2_SIZE3 );
		WeightAnmRotParamSet( wk, 0x800, 0 );
		wk->main_seq++;

	case 1:
		CATS_ObjectRotationAddCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], wk->rot_mv );
		rot = CATS_ObjectRotationGetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD] );
		RotateMove( wk->sys, rot );
		wk->rot_mv += wk->rot_spd;
		if( wk->mv == 0 ){
			if( rot <= WEIGHT_ROT_MIN ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MIN );
				RotateMove( wk->sys, WEIGHT_ROT_MIN );
				wk->main_seq++;
			}else{
				break;
			}
		}else{
			if( rot >= WEIGHT_ROT_MAX ){
				CATS_ObjectRotationSetCap( wk->sys->cap[ZKN2_OBJ_SIZE_BOARD], WEIGHT_ROT_MAX );
				RotateMove( wk->sys, WEIGHT_ROT_MAX );
				wk->main_seq++;
			}else{
				break;
			}
		}


	case 2:
		WeightAnmJumpParamSet( wk, -24, 0 );
		wk->main_seq++;

	case 3:
		if( WeightAnmJumpCheck( wk ) == FALSE ){
			return FALSE;
		}
		{
			s16	x, y;
			ObjPosGet( wk->sys, wk->jump_obj_c, &x, &y, NNS_G2D_VRAM_TYPE_2DMAIN );
			if( y <= -256 ){
				return FALSE;
			}
		}
	}

	return TRUE;
}


//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページＯＢＪ初期化
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_FormPageInit( ZKN2_WORK * wk )
{
	PokeIconResLoad( wk, 6 );
	PokeGraDummyResLoad( wk );
	PokeGra2DummyResLoad( wk );

	FormPageObjAdd( wk );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページＯＢＪ削除
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_FormPageDelete( ZKN2_WORK * wk )
{
	u32	i;

	for( i=ZKN2_OBJ_FORM_POKEGRA1; i<ZKN2_OBJ_FORM_MAX; i++ ){
		ClactDel( wk, i );
	}

	PokeIconResFree( wk, 6 );
	PokeGraDummyResFree( wk );
	PokeGra2DummyResFree( wk );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページＯＢＪ追加
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void FormPageObjAdd( ZKN2_WORK * wk )
{
	u32	i;

	for( i=ZKN2_OBJ_FORM_POKEGRA1; i<=ZKN2_OBJ_FORM_POKEGRA4; i++ ){
		wk->cap[i] = CATS_ObjectAdd_S_SubDistance(
						wk->csp, wk->crp,
						&ClaFormPagePrm[i-ZKN2_OBJ_FORM_POKEGRA1], ZKN2_SUB_ACTOR_DISTANCE );
	}

	for( i=ZKN2_OBJ_FORM_BAR; i<ZKN2_OBJ_FORM_MAX; i++ ){
		wk->cap[i] = CATS_ObjectAdd_S(
						wk->csp, wk->crp, &ClaFormPagePrm[i-ZKN2_OBJ_FORM_POKEGRA1] );
	}

	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_ARROW_LU, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_ARROW_LD, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_ARROW_RU, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_ARROW_RD, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_CURSOR, FALSE );

	FormPage1PokeGraInit( wk, 0, POKEGRA_PAL_VRAM );
	ZKN2OBJ_FormPage1PokeIconInit( wk );

	DetailListBarAnmChg(
		wk, ZKN2_OBJ_FORM_BAR, wk->detail_form_max,
		FormListBarAnmMaxTbl, NELEMS(FormListBarAnmMaxTbl) );
	ZKN2OBJ_FormListBarPosYSet( wk );

	ZKN2OBJ_DetailListArrowAnmChange(
		wk, wk->detail_form_pos, wk->detail_form_max, ZKN2_OBJ_FORM_ARROW_U );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページ１のポケグラ切り替え
 *
 * @param	wk		図鑑画面ワーク
 * @param	pos		リスト位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_FormPage1PokeGraChange( ZKN2_WORK * wk, u32 pos )
{
	FormPage1PokeGraInit( wk, pos, POKEGRA_PAL_VRAM );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページ１のポケグラ初期化
 *
 * @param	wk			図鑑画面ワーク
 * @param	pos			リスト位置
 * @param	pal_mode	パレット転送モード
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void FormPage1PokeGraInit( ZKN2_WORK * wk, u32 pos, u32 pal_mode )
{
	u32	height;
	u32	obj1, obj2;
	u8	sex;
	u8	frm;

	FormSexGet( wk, pos, &frm, &sex );

	if( wk->detail_form_swap == 0 ){
		obj1 = ZKN2_OBJ_FORM_POKEGRA1;
		obj2 = ZKN2_OBJ_FORM_POKEGRA2;
		ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA3, FALSE );
		ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA4, FALSE );
	}else{
		obj1 = ZKN2_OBJ_FORM_POKEGRA3;
		obj2 = ZKN2_OBJ_FORM_POKEGRA4;
		ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA1, FALSE );
		ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA2, FALSE );
	}
	wk->detail_form_swap ^= 1;

	PokeGraChangeCore( wk, wk->detail_mons, frm, sex, PARA_FRONT, obj1, pal_mode );
//	height = PokeHeightGet( wk->detail_mons, sex, PARA_FRONT, frm, 0 );
	CATS_ObjectPosSetCap_SubSurface(
//		wk->cap[obj1], FORM1_POKE_L_PX, FORM1_POKE_L_PY+height, ZKN2_SUB_ACTOR_DISTANCE );
		wk->cap[obj1], FORM1_POKE_L_PX, FORM1_POKE_L_PY, ZKN2_SUB_ACTOR_DISTANCE );

	PokeGraChangeCore( wk, wk->detail_mons, frm, sex, PARA_BACK, obj2, pal_mode );
	height = PokeHeightGet( wk->detail_mons, sex, PARA_BACK, frm, 0 );
	CATS_ObjectPosSetCap_SubSurface(
		wk->cap[obj2], FORM1_POKE_R_PX, FORM1_POKE_R_PY+height, ZKN2_SUB_ACTOR_DISTANCE );

	ZKN2OBJ_Vanish( wk, obj1, TRUE );
	ZKN2OBJ_Vanish( wk, obj2, TRUE );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページのポケアイコン切り替え
 *
 * @param	wk			図鑑画面ワーク
 * @param	id			OBJ ID
 * @param	pos			リスト位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void FormPokeIconChange( ZKN2_WORK * wk, u32 id, u32 pos )
{
	u32	frm;

	if( wk->detail_form[pos] & ZKN2MAIN_FORM_EXTRA ){
		frm = wk->detail_form[pos] ^ ZKN2MAIN_FORM_EXTRA;
		if( wk->detail_mons == MONSNO_PITYUU ){
			if( frm == 2 ){
				frm = 1;
			}else{
				frm = 0;
			}
		}
	}else{
		frm = 0;
	}
	PokeIconChange( wk, wk->detail_mons, frm, id );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページ１のポケアイコン初期化
 *
 * @param	wk			図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_FormPage1PokeIconInit( ZKN2_WORK * wk )
{
	u32	pos;
	u32	i;

	for( i=0; i<6; i++ ){
		pos = wk->detail_form_pos + i - 2;
		if( pos < 0 || pos >= wk->detail_form_max ){
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEICON1+i, FALSE );
		}else{
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEICON1+i, TRUE );
			FormPokeIconChange( wk, ZKN2_OBJ_FORM_POKEICON1+i, pos );
		}
		ObjPosSet(
			wk, ZKN2_OBJ_FORM_POKEICON1+i,
			FORM1_POKEICON_PX, FORM1_POKEICON_PY+FORM1_POKEICON_SY*i, OBJ_PUT_DISP_MAIN );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページのポケアイコン移動初期化
 *
 * @param	wk		図鑑画面ワーク
 * @param	mv		移動方向
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_FormPokeIconMoveInit( ZKN2_WORK * wk, s16 mv )
{
	u32	i;
	s16	x, y;

	for( i=0; i<6; i++ ){
		ObjPosGet( wk, ZKN2_OBJ_FORM_POKEICON1+i, &x, &y, OBJ_PUT_DISP_MAIN );
		if( y == FORM1_POKEICON_PY-FORM1_POKEICON_SY ||
			y == FORM1_POKEICON_PY+FORM1_POKEICON_SY*5 ){
			break;
		}
	}
	if( mv < 0 ){
		ObjPosSet(
			wk, ZKN2_OBJ_FORM_POKEICON1+i,
			FORM1_POKEICON_PX, FORM1_POKEICON_PY+FORM1_POKEICON_SY*5, OBJ_PUT_DISP_MAIN );
		if( ( wk->detail_form_pos+2 ) >= wk->detail_form_max ){
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEICON1+i, FALSE );
		}else{
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEICON1+i, TRUE );
			FormPokeIconChange( wk, ZKN2_OBJ_FORM_POKEICON1+i, wk->detail_form_pos+2 );
		}
	}else{
		ObjPosSet(
			wk, ZKN2_OBJ_FORM_POKEICON1+i,
			FORM1_POKEICON_PX, FORM1_POKEICON_PY-FORM1_POKEICON_SY, OBJ_PUT_DISP_MAIN );
		if( ( wk->detail_form_pos-2 ) < 0 ){
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEICON1+i, FALSE );
		}else{
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEICON1+i, TRUE );
			FormPokeIconChange( wk, ZKN2_OBJ_FORM_POKEICON1+i, wk->detail_form_pos-2 );
		}
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページのポケアイコン移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	mv		移動値
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_FormPokeIconMove( ZKN2_WORK * wk, s16 mv )
{
	u32	i;

	for( i=0; i<6; i++ ){
		ObjMove( wk, ZKN2_OBJ_FORM_POKEICON1+i, 0, mv, OBJ_PUT_DISP_MAIN );
	}
}



//--------------------------------------------------------------------------------------------
/**
 * 詳細画面リストスクロール矢印アニメ切り替え
 *
 * @param	wk		図鑑画面ワーク
 * @param	pos		現在地
 * @param	max		項目数
 * @param	objID	OBJ ID
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_DetailListArrowAnmChange( ZKN2_WORK * wk, s8 pos, s8 max, u16 objID )
{
	if( pos == 0 ){
		ZKN2OBJ_AnmSet( wk, objID, ZKN2OBJ_M_ANM_UP_OFF );
	}else{
		ZKN2OBJ_AnmSet( wk, objID, ZKN2OBJ_M_ANM_UP_ON );
	}
	if( pos == ( max - 1 ) ){
		ZKN2OBJ_AnmSet( wk, objID+1, ZKN2OBJ_M_ANM_DOWN_OFF );
	}else{
		ZKN2OBJ_AnmSet( wk, objID+1, ZKN2OBJ_M_ANM_DOWN_ON );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面リスト切り替えバーのアニメ変更
 *
 * @param	wk			図鑑画面ワーク
 * @param	objID		OBJ ID
 * @param	list_max	項目数
 * @param	tbl			項目数とアニメのテーブル
 * @param	tbl_max		テーブル数
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void DetailListBarAnmChg( ZKN2_WORK * wk, u16 objID, s8 list_max, const u16 * tbl, u32 tbl_max )
{
	ZKN2OBJ_AnmSet( wk, objID, DetailListBarAnmGet(wk,list_max,tbl,tbl_max) );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面リスト切り替えバーのアニメ番号取得
 *
 * @param	wk			図鑑画面ワーク
 * @param	list_max	項目数
 * @param	tbl			項目数とアニメのテーブル
 * @param	tbl_max		テーブル数
 *
 * @return	アニメ番号
 */
//--------------------------------------------------------------------------------------------
static u32 DetailListBarAnmGet( ZKN2_WORK * wk, s8 list_max, const u16 * tbl, u32 tbl_max )
{
	u32	i;

	for( i=0; i<tbl_max; i++ ){
		if( list_max <= tbl[i] ){
			break;
		}
	}
	return ( ZKN2OBJ_M_ANM_BAR4 + i );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面リスト切り替えバーのＹサイズ取得
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 * @param	tbl		Ｙサイズテーブル
 *
 * @return	Ｙサイズ
 */
//--------------------------------------------------------------------------------------------
static u8 DetailListBarYSizeGet( ZKN2_WORK * wk, u32 objID, const u8 * tbl )
{
	u32	anm = CATS_ObjectAnimeSeqGetCap( wk->cap[objID] );

	return tbl[ anm - ZKN2OBJ_M_ANM_BAR4 ];
}

//--------------------------------------------------------------------------------------------
/**
 * リスト切り替えバーのＹ座標移動最小値取得
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 * @param	tbl		Ｙサイズテーブル
 * @param	py		リールＯＢＪの表示Ｙ座標
 * @param	sy		リールＯＢＪのＹサイズ
 *
 * @return	Ｙ座標移動最小値
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2OBJ_DetailListBarMoveYMin( ZKN2_WORK * wk, u32 objID, const u8 * tbl, u32 py, u32 sy )
{
	u32	siz = DetailListBarYSizeGet( wk, objID, tbl );
	return ( py - sy / 2 + siz / 2 );
}

//--------------------------------------------------------------------------------------------
/**
 * リスト切り替えバーのＹ座標移動最大値取得
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 * @param	tbl		Ｙサイズテーブル
 * @param	py		リールＯＢＪの表示Ｙ座標
 * @param	sy		リールＯＢＪのＹサイズ
 *
 * @return	Ｙ座標移動最小値
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2OBJ_DetailListBarMoveYMax( ZKN2_WORK * wk, u32 objID, const u8 * tbl, u32 py, u32 sy )
{
	u32	siz = DetailListBarYSizeGet( wk, objID, tbl );
	return ( py + sy / 2 - siz / 2 );
}

//--------------------------------------------------------------------------------------------
/**
 * 指定座標にリスト切り替えバーがあるか（詳細画面姿ページ用）
 *
 * @param	wk		図鑑画面ワーク
 * @param	tpx		Ｘ座標
 * @param	tpy		Ｙ座標
 *
 * @retval	"TRUE = あり"
 * @retval	"FALSE = なし"
 */
//--------------------------------------------------------------------------------------------
BOOL ZKN2OBJ_FormListBarCheck( ZKN2_WORK * wk, u32 tpx, u32 tpy )
{
	s16	obj_x, obj_y;
	u32	sy;

	CATS_ObjectPosGetCap( wk->cap[ZKN2_OBJ_FORM_BAR], &obj_x, &obj_y );

	sy = DetailListBarYSizeGet( wk, ZKN2_OBJ_FORM_BAR, FormListBarDotYSiz );

	if( tpx >= ( obj_x - LIST_BAR_SX / 2 ) && tpx <= ( obj_x + LIST_BAR_SX / 2 ) &&
		tpy >= ( obj_y - sy / 2 ) && tpy <= ( obj_y + sy / 2 ) ){
		return TRUE;
	}

	return FALSE;
}

//--------------------------------------------------------------------------------------------
/**
 * 指定座標にリスト切り替えバーがあるか（詳細画面分布ページ用）
 *
 * @param	wk		図鑑画面ワーク
 * @param	tpx		Ｘ座標
 * @param	tpy		Ｙ座標
 *
 * @retval	"TRUE = あり"
 * @retval	"FALSE = なし"
 */
//--------------------------------------------------------------------------------------------
BOOL ZKN2OBJ_PlaceListBarCheck( ZKN2_WORK * wk, u32 tpx, u32 tpy )
{
	s16	obj_x, obj_y;
	u32	sy;

	CATS_ObjectPosGetCap( wk->cap[ZKN2_OBJ_ENC_BAR], &obj_x, &obj_y );

	sy = DetailListBarYSizeGet( wk, ZKN2_OBJ_ENC_BAR, PlaceListBarDotYSiz );

	if( tpx >= ( obj_x - LIST_BAR_SX / 2 ) && tpx <= ( obj_x + LIST_BAR_SX / 2 ) &&
		tpy >= ( obj_y - sy / 2 ) && tpy <= ( obj_y + sy / 2 ) ){
		return TRUE;
	}

	return FALSE;
}

//--------------------------------------------------------------------------------------------
/**
 * 指定座標にリスト切り替えバーを移動（詳細画面姿ページ用）
 *
 * @param	wk		図鑑画面ワーク
 * @param	tpx		Ｘ座標
 * @param	tpy		Ｙ座標
 *
 * @retval	"TRUE = スクロール"
 * @retval	"FALSE = それ以外"
 */
//--------------------------------------------------------------------------------------------
BOOL ZKN2OBJ_FormListBarMove( ZKN2_WORK * wk, u32 tpx, u32 tpy )
{
	u32	prm;
	s16	obj_x, obj_y;

	CATS_ObjectPosGetCap( wk->cap[ZKN2_OBJ_FORM_BAR], &obj_x, &obj_y );

	prm = ZKN2OBJ_DetailListBarMoveYMin(
			wk, ZKN2_OBJ_FORM_BAR, FormListBarDotYSiz, FORMLIST_RAIL_PY, FORMLIST_RAIL_SY );
	if( tpy < prm ){
		tpy = prm;
	}
	prm = ZKN2OBJ_DetailListBarMoveYMax(
			wk, ZKN2_OBJ_FORM_BAR, FormListBarDotYSiz, FORMLIST_RAIL_PY, FORMLIST_RAIL_SY );
	if( tpy > prm ){
		tpy = prm;
	}

	CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_FORM_BAR], obj_x, tpy );

	{
		u32	scr_siz;
		u32	scr_pos;
		u32	min;
		u32	dot;
		u32	i;

		min = ZKN2OBJ_DetailListBarMoveYMin(
				wk, ZKN2_OBJ_FORM_BAR, FormListBarDotYSiz, FORMLIST_RAIL_PY, FORMLIST_RAIL_SY );
		dot = ZKN2OBJ_DetailListBarMoveYMax( wk, ZKN2_OBJ_FORM_BAR, FormListBarDotYSiz, FORMLIST_RAIL_PY, FORMLIST_RAIL_SY ) - min;

		scr_siz = ( ( dot << 8 ) / (wk->detail_form_max-1) );
		scr_pos = ( tpy - min ) << 8;

		for( i=0; i<=(wk->detail_form_max-1); i++ ){
			if( scr_pos >= ( scr_siz * i ) && scr_pos < ( scr_siz * (i+1) ) ){
				if( wk->detail_form_pos != i ){
					wk->detail_form_pos = i;
					return TRUE;
				}
				break;
			}
		}
	}

	return FALSE;
}

//--------------------------------------------------------------------------------------------
/**
 * 指定座標にリスト切り替えバーを移動（詳細画面分布ページ用）
 *
 * @param	wk		図鑑画面ワーク
 * @param	tpx		Ｘ座標
 * @param	tpy		Ｙ座標
 *
 * @retval	"TRUE = スクロール"
 * @retval	"FALSE = それ以外"
 */
//--------------------------------------------------------------------------------------------
BOOL ZKN2OBJ_PlaceListBarMove( ZKN2_WORK * wk, u32 tpx, u32 tpy )
{
	u32	prm;
	s16	obj_x, obj_y;

	CATS_ObjectPosGetCap( wk->cap[ZKN2_OBJ_ENC_BAR], &obj_x, &obj_y );

	prm = ZKN2OBJ_DetailListBarMoveYMin(
			wk, ZKN2_OBJ_ENC_BAR, PlaceListBarDotYSiz, PLACELIST_RAIL_PY, PLACELIST_RAIL_SY );
	if( tpy < prm ){
		tpy = prm;
	}
	prm = ZKN2OBJ_DetailListBarMoveYMax(
			wk, ZKN2_OBJ_ENC_BAR, PlaceListBarDotYSiz, PLACELIST_RAIL_PY, PLACELIST_RAIL_SY );
	if( tpy > prm ){
		tpy = prm;
	}

	CATS_ObjectPosSetCap( wk->cap[ZKN2_OBJ_ENC_BAR], obj_x, tpy );

	{
		u32	scr_siz;
		u32	scr_pos;
		u32	min;
		u32	dot;
		u32	i;

		min = ZKN2OBJ_DetailListBarMoveYMin(
				wk, ZKN2_OBJ_ENC_BAR, PlaceListBarDotYSiz, PLACELIST_RAIL_PY, PLACELIST_RAIL_SY );
		dot = ZKN2OBJ_DetailListBarMoveYMax( wk, ZKN2_OBJ_ENC_BAR, PlaceListBarDotYSiz, PLACELIST_RAIL_PY, PLACELIST_RAIL_SY ) - min;

		scr_siz = ( ( dot << 8 ) / (wk->enc_data.all.num-1) );
		scr_pos = ( tpy - min ) << 8;

		for( i=0; i<=(wk->enc_data.all.num-1); i++ ){
			if( scr_pos >= ( scr_siz * i ) && scr_pos < ( scr_siz * (i+1) ) ){
				if( wk->detail_place_pos != i ){
					wk->detail_place_pos = i;
					return TRUE;
				}
				break;
			}
		}
	}

	return FALSE;
}


//--------------------------------------------------------------------------------------------
/**
 * スクロール値からリスト切り替えバーのＹ座標を取得（詳細画面姿ページ用）
 *
 * @param	wk		図鑑画面ワーク
 * @param	scr		スクロール値
 *
 * @return	Ｙ座標
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2OBJ_FormListBarPosYGet( ZKN2_WORK * wk, u32 scr )
{
	u32	min, max, siz;

	min = ZKN2OBJ_DetailListBarMoveYMin(
			wk, ZKN2_OBJ_FORM_BAR, FormListBarDotYSiz, FORMLIST_RAIL_PY, FORMLIST_RAIL_SY );
	max = ZKN2OBJ_DetailListBarMoveYMax(
			wk, ZKN2_OBJ_FORM_BAR, FormListBarDotYSiz, FORMLIST_RAIL_PY, FORMLIST_RAIL_SY );

	if( scr == (wk->detail_form_max-1) ){
		return max;
	}

	siz = ( ( max - min ) << 8 ) / (wk->detail_form_max-1);

	return ( min + ( ( siz * scr ) >> 8 ) );
}

//--------------------------------------------------------------------------------------------
/**
 * スクロール値からリスト切り替えバーのＹ座標を取得（詳細画面分布ページ用）
 *
 * @param	wk		図鑑画面ワーク
 * @param	scr		スクロール値
 *
 * @return	Ｙ座標
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2OBJ_PlaceListBarPosYGet( ZKN2_WORK * wk, u32 scr )
{
	u32	min, max, siz;

	min = ZKN2OBJ_DetailListBarMoveYMin(
			wk, ZKN2_OBJ_ENC_BAR, PlaceListBarDotYSiz, PLACELIST_RAIL_PY, PLACELIST_RAIL_SY );
	max = ZKN2OBJ_DetailListBarMoveYMax(
			wk, ZKN2_OBJ_ENC_BAR, PlaceListBarDotYSiz, PLACELIST_RAIL_PY, PLACELIST_RAIL_SY );

	if( scr == (wk->enc_data.all.num-1) ){
		return max;
	}

	siz = ( ( max - min ) << 8 ) / (wk->enc_data.all.num-1);

	return ( min + ( ( siz * scr ) >> 8 ) );
}

//--------------------------------------------------------------------------------------------
/**
 * リスト切り替えバーの１フレームのＹ移動量を取得
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 * @param	py		Ｙ座標
 * @param	cnt		動作フレーム数
 *
 * @return	Ｙ移動量
 */
//--------------------------------------------------------------------------------------------
u32 ZKN2OBJ_DetailListBarAotoMoveCntGet( ZKN2_WORK * wk, u32 objID, u32 py, u32 cnt )
{
	s16	obj_x, obj_y;

	CATS_ObjectPosGetCap( wk->cap[objID], &obj_x, &obj_y );
	if( py >= obj_y ){
		return ( ( py - obj_y ) / cnt );
	}
	return ( ( obj_y - py ) / cnt );
}

//--------------------------------------------------------------------------------------------
/**
 * リスト切り替えバーを移動
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 * @param	my		Ｙ移動量
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_DetailListBarAotoMove( ZKN2_WORK * wk, u32 objID, s32 my )
{
	s16	obj_x, obj_y;

	CATS_ObjectPosGetCap( wk->cap[objID], &obj_x, &obj_y );
	CATS_ObjectPosSetCap( wk->cap[objID], obj_x, obj_y+my );
}

//--------------------------------------------------------------------------------------------
/**
 * リスト切り替えバーを現在のスクロール位置へ移動（詳細画面姿ページ用）
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_FormListBarPosYSet( ZKN2_WORK * wk )
{
	s16	obj_x, obj_y;

	CATS_ObjectPosGetCap( wk->cap[ZKN2_OBJ_FORM_BAR], &obj_x, &obj_y );
	CATS_ObjectPosSetCap(
		wk->cap[ZKN2_OBJ_FORM_BAR],
		obj_x, ZKN2OBJ_FormListBarPosYGet(wk,wk->detail_form_pos) );
}

//--------------------------------------------------------------------------------------------
/**
 * リスト切り替えバーを現在のスクロール位置へ移動（詳細画面分布ページ用）
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_PlaceListBarPosYSet( ZKN2_WORK * wk )
{
	s16	obj_x, obj_y;

	CATS_ObjectPosGetCap( wk->cap[ZKN2_OBJ_ENC_BAR], &obj_x, &obj_y );
	CATS_ObjectPosSetCap(
		wk->cap[ZKN2_OBJ_ENC_BAR],
		obj_x, ZKN2OBJ_PlaceListBarPosYGet(wk,wk->detail_place_pos) );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページ１ＯＢＪ表示
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_Form1PageObjPut( ZKN2_WORK * wk )
{
	FormPage1PokeGraInit( wk, wk->detail_form_pos, POKEGRA_PAL_FADE );
	ZKN2OBJ_FormPage1PokeIconInit( wk );

	ZKN2OBJ_FormListBarPosYSet( wk );
	ZKN2OBJ_DetailListArrowAnmChange(
		wk, wk->detail_form_pos, wk->detail_form_max, ZKN2_OBJ_FORM_ARROW_U );

	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_BAR, TRUE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_ARROW_U, TRUE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_ARROW_D, TRUE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_RAIL, TRUE );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページ１ＯＢＪ非表示
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_Form1PageObjOff( ZKN2_WORK * wk )
{
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_BAR, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_ARROW_U, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_ARROW_D, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_RAIL, FALSE );

	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEICON1, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEICON2, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEICON3, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEICON4, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEICON5, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEICON6, FALSE );

	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA1, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA2, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA3, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA4, FALSE );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページ２ＯＢＪ表示
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_Form2PageObjPut( ZKN2_WORK * wk )
{
	if( wk->detail_form_max >= 3 ){
		ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_ARROW_LU, TRUE );
		ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_ARROW_LD, TRUE );
		ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_ARROW_RU, TRUE );
		ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_ARROW_RD, TRUE );
		ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_CURSOR, TRUE );
	}

	ZKN2OBJ_Form2PagePokeIconChange( wk, ZKN2_OBJ_FORM_POKEICON1, wk->detail_form_pos );
	ZKN2OBJ_Form2PagePokeIconChange( wk, ZKN2_OBJ_FORM_POKEICON2, wk->detail_form_pos2 );
	ObjPosSet(
		wk, ZKN2_OBJ_FORM_POKEICON1, FORM2_POKEICON_LPX, FORM2_POKEICON_LPY, OBJ_PUT_DISP_MAIN );
	ObjPosSet(
		wk, ZKN2_OBJ_FORM_POKEICON2, FORM2_POKEICON_RPX, FORM2_POKEICON_RPY, OBJ_PUT_DISP_MAIN );

	Form2PagePokeGraChange( wk, ZKN2_OBJ_FORM_POKEGRA1, wk->detail_form_pos, POKEGRA_PAL_FADE );
	Form2PagePokeGraChange( wk, ZKN2_OBJ_FORM_POKEGRA2, wk->detail_form_pos2, POKEGRA_PAL_FADE );

	ZKN2OBJ_Form2CursorPut( wk );

	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEICON1, TRUE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEICON2, TRUE );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページ２ＯＢＪ非表示
 *
 * @param	wk		図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_Form2PageObjOff( ZKN2_WORK * wk )
{
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_ARROW_LU, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_ARROW_LD, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_ARROW_RU, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_ARROW_RD, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_CURSOR, FALSE );

	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEICON1, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEICON2, FALSE );

	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA1, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA2, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA3, FALSE );
	ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA4, FALSE );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページ２ ポケモンアイコン切り替え
 *
 * @param	wk		図鑑画面ワーク
 * @param	objID	OBJ ID
 * @param	pos		リスト位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_Form2PagePokeIconChange( ZKN2_WORK * wk, u32 objID, s8 pos )
{
	FormPokeIconChange( wk, objID, pos );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページ２ ポケグラ切り替え
 *
 * @param	wk			図鑑画面ワーク
 * @param	objID		OBJ ID
 * @param	pos			リスト位置
 * @param	pal_mode	パレット転送モード
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void Form2PagePokeGraChange( ZKN2_WORK * wk, u32 objID, u32 pos, u32 pal_mode )
{
	u8	px, py;
	u8	sex;
	u8	frm;
	u8	dir;
	u8	height;

	FormSexGet( wk, pos, &frm, &sex );

	if( wk->detail_form_dir == 0 ){
		dir = PARA_FRONT;
		height = 0;
	}else{
		dir = PARA_BACK;
		height = PokeHeightGet( wk->detail_mons, sex, dir, frm, 0 );
	}

	if( objID == ZKN2_OBJ_FORM_POKEGRA1 ){
		px = FORM1_POKE_L_PX;
		py = FORM1_POKE_L_PY + height;
		if( wk->detail_form_swap == 1 ){
			objID = ZKN2_OBJ_FORM_POKEGRA3;
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA1, FALSE );
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA3, TRUE );
		}else{
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA1, TRUE );
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA3, FALSE );
		}
		wk->detail_form_swap ^= 1;
	}else if( objID == ZKN2_OBJ_FORM_POKEGRA2 ){
		px = FORM1_POKE_R_PX;
		py = FORM1_POKE_R_PY + height;
		if( wk->detail_form_swap2 == 1 ){
			objID = ZKN2_OBJ_FORM_POKEGRA4;
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA2, FALSE );
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA4, TRUE );
		}else{
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA2, TRUE );
			ZKN2OBJ_Vanish( wk, ZKN2_OBJ_FORM_POKEGRA4, FALSE );
		}
		wk->detail_form_swap2 ^= 1;
	}

	PokeGraChangeCore( wk, wk->detail_mons, frm, sex, dir, objID, pal_mode );
	ObjPosSet( wk, objID, px, py, OBJ_PUT_DISP_SUB );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページ２ ポケグラ切り替え
 *
 * @param	wk			図鑑画面ワーク
 * @param	objID		OBJ ID
 * @param	pos			リスト位置
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_Form2PagePokeGraChange( ZKN2_WORK * wk, u32 objID, u32 pos )
{
	Form2PagePokeGraChange( wk, objID, pos, POKEGRA_PAL_VRAM );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面姿ページ２ カーソル配置
 *
 * @param	wk			図鑑画面ワーク
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_Form2CursorPut( ZKN2_WORK * wk )
{
	if( wk->detail_form2_cursor == 0 ){
		ObjPosSet(
			wk, ZKN2_OBJ_FORM_CURSOR,
			FORM2_CURSOR_LPX, FORM2_CURSOR_LPY, OBJ_PUT_DISP_MAIN );
	}else{
		ObjPosSet(
			wk, ZKN2_OBJ_FORM_CURSOR,
			FORM2_CURSOR_RPX, FORM2_CURSOR_RPY, OBJ_PUT_DISP_MAIN );
	}
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面分布ページ 顔アイコンアニメ変更
 *
 * @param	wk			図鑑画面ワーク
 * @param	mv			点滅動作フラグ
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
void ZKN2OBJ_EncFaceAnmChange( ZKN2_WORK * wk, BOOL mv )
{
	u32	anm;

	if( MyStatus_GetMySex( wk->dat->myst ) == 0 ){
		anm = 0;
	}else{
		anm = 1;
	}
	if( mv == TRUE ){
		anm += 2;
	}

	ZKN2OBJ_AnmSet( wk, ZKN2_OBJ_ENC_FACE, anm );
}



//--------------------------------------------------------------------------------------------
/**
 * 詳細画面大きさページ ポケグラをＢＧにセット
 *
 * @param	wk			図鑑画面ワーク
 * @param	mons		ポケモン番号
 * @param	frm			フォルム
 * @param	sex			性別
 * @param	dir			向き
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeGraBgSet(
				ZKN2_WORK * wk, u16 mons, u8 frm, u8 sex, u8 dir )
{
	SOFT_SPRITE_ARC  ssa;
	void * buf;
	void * buf8;
	NNSG2dImageProxy * ipc;
	NNSG2dImagePaletteProxy * ipp;
	u32	cgx;
	u32	pal;
	u32	rand;
	CHANGES_INTO_DATA_RECT rect = { POKE_TEX_X, POKE_TEX_Y, POKE_TEX_W, POKE_TEX_H, };

	buf  = sys_AllocMemoryLo( HEAPID_ZUKAN, POKEGRA_TEX_SIZE );

	if( mons == MONSNO_PATTIIRU ){
		rand = ZukanWork_GetPokeRandomFlag( wk->dat->zukan_work, ZUKAN_WORK_RANDOM_PACHI );
	}else{
		rand = 0;
	}

	PokeGraArcDataGet(
		&ssa,
		mons,
		sex,
		dir,
		PARA_NORMAL,	// color
		frm,
		rand );

	Ex_ChangesInto_OAM_from_PokeTex_RC(
		ssa.arc_no, ssa.index_chr, HEAPID_ZUKAN,
		&rect, buf, rand, FALSE, PARA_FRONT, mons );

	buf8 = GF_BGL_4BitCgxChange8Bit( buf, POKEGRA_TEX_SIZE, 15, HEAPID_ZUKAN );

	GF_BGL_LoadCharacter( wk->bgl, ZKN2_BGF_UNDER_S, buf8, POKEGRA_TEX_SIZE*2, 1 );

	sys_FreeMemoryEz( buf8 );
	sys_FreeMemoryEz( buf );

	GF_BGL_ScrWrite( wk->bgl, ZKN2_BGF_UNDER_S, PokeGraScrn, 11, 11, 10, 10 );
	GF_BGL_LoadScreenV_Req( wk->bgl, ZKN2_BGF_UNDER_S );
}

//--------------------------------------------------------------------------------------------
/**
 * 詳細画面大きさページ ポケグラＢＧのスクロールと拡縮
 *
 * @param	wk		図鑑画面ワーク
 * @param	py		Ｙスクロール値
 * @param	scale	拡縮値
 *
 * @return	none
 */
//--------------------------------------------------------------------------------------------
static void PokeGraBgScroll( ZKN2_WORK * wk, int py, int scale )
{
	MtxFx22 mtx22;
	fx32 fx_scale;

	fx_scale = FX_Inv( HEIGHT_SCALE(scale) );

    mtx22._00 = fx_scale;
    mtx22._01 = 0;
    mtx22._10 = 0;
    mtx22._11 = fx_scale;

	GF_BGL_AffineScrollSet(
		wk->bgl, ZKN2_BGF_UNDER_S, GF_BGL_SCROLL_X_SET, SIZE_POKEGRA_BG_PX, &mtx22, 128, 128 );
	GF_BGL_AffineScrollSet(
		wk->bgl, ZKN2_BGF_UNDER_S, GF_BGL_SCROLL_Y_SET, SIZE_POKEGRA_BG_PY-py, &mtx22, 128, 128 );
}